Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Observe): missing traces in Mlflow #148

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GALLLASMILAN
Copy link
Contributor

@GALLLASMILAN GALLLASMILAN commented Jan 7, 2025

We need to call the forcePush method on the BatchSpanProcessor for each trace. Otherwise, this default processor skips some traces and doesn't send them to the OTLP server.

I added a new isOpenTelemetryEnabled variable, that allows the telemetry only for production environment:

export const isOpenTelemetryEnabled = Boolean(process.env.NODE_ENV === 'production');

Closes: i-am-bee/bee-observe#24

@GALLLASMILAN GALLLASMILAN force-pushed the fix-missing-traces-in-observe branch from 904e842 to 416948c Compare January 7, 2025 07:49
@GALLLASMILAN GALLLASMILAN marked this pull request as ready for review January 7, 2025 07:52
@GALLLASMILAN GALLLASMILAN requested a review from a team as a code owner January 7, 2025 07:52
@@ -144,6 +145,7 @@ export async function executeRun(run: LoadedRun) {
);

await agentRun;
if (isOpenTelemetryEnabled) await batchSpanProcessor.forceFlush();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? I got the impression that opentelemetry should quietly work outside of your code and flush regularly on its own

@GALLLASMILAN GALLLASMILAN marked this pull request as draft January 7, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing traces in Observe
2 participants