You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR OTEL_SDK_DISABLED behaves differently in v2 of @vercel/otel
If you are using this environment variable to enable/disable OpenTelemetry's SDK (and even @vercel/otel's start()), change the usage of "false" (or "0") to "".
In v2's @vercel/otel, the package evaluates OTEL_SDK_DISABLED as "if it is set, it is disabled, if it is not set (or is empty string), it is enabled".
In v1's case, because it made use of the removed parseEnvironment function from OpenTelemetry, it would evaluate the value as a boolean.
This means that OTEL_SDK_DISABLED=true and OTEL_SDK_DISABLED=false would evaluate as the boolean value of true or false:
My take on this is that either @vercel/otel should backport parseEnviroment's functionality or at least state it as a breaking change, at least for those using this ENV variable, given that it disables completely the SDK whether you set it to "false" or "true" (old values).
In any case, setting it to "" instead of "false" should do the trick
Note
TL;DR
OTEL_SDK_DISABLEDbehaves differently inv2of@vercel/otelIf you are using this environment variable to enable/disable OpenTelemetry's SDK (and even
@vercel/otel'sstart()), change the usage of"false"(or"0") to"".In v2's
@vercel/otel, the package evaluatesOTEL_SDK_DISABLEDas "if it is set, it is disabled, if it is not set (or is empty string), it is enabled".In v1's case, because it made use of the removed
parseEnvironmentfunction from OpenTelemetry, it would evaluate the value as a boolean.This means that
OTEL_SDK_DISABLED=trueandOTEL_SDK_DISABLED=falsewould evaluate as the boolean value oftrueorfalse:OTEL_SDK_DISABLEDset as boolean variable in OpenTelemetry v1.30.1'true'Now v2 is doing
Boolean(env.OTEL_SDK_DISABLED). Meaning thatBoolean("false") === true.My take on this is that either
@vercel/otelshould backportparseEnviroment's functionality or at least state it as a breaking change, at least for those using this ENV variable, given that it disables completely the SDK whether you set it to"false"or"true"(old values).In any case, setting it to
""instead of"false"should do the trick