Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

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
);

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing traces in Observe

3 participants