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

The current logic for determining if the OpenTelemetry SDK (OTEL) is enabled is not working as expected #4873

Open
willianccs opened this issue Nov 11, 2024 · 0 comments

Comments

@willianccs
Copy link

willianccs commented Nov 11, 2024

Problem

The current logic for determining if the OpenTelemetry SDK (OTEL) is enabled is not working as expected. Specifically, the following line of code:

const otelSdkEnabled = process.env.DD_TRACE_OTEL_ENABLED ||
process.env.OTEL_SDK_DISABLED
? !process.env.OTEL_SDK_DISABLED
: undefined

Suggested Solution

To fix this issue, we need to explicitly check the values of the environment variables. Here is the corrected logic:

const otelSdkEnabled = process.env.DD_TRACE_OTEL_ENABLED === 'true' || (process.env.OTEL_SDK_DISABLED !== 'true' && process.env.OTEL_SDK_DISABLED !== undefined);

This should resolve the issue and ensure the logic works correctly without needing to explicitly set OTEL_SDK_DISABLED to false.

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

No branches or pull requests

1 participant