Custom context manager not respected when span processors / exporters are configured via env vars #4776
Labels
bug
Something isn't working
pkg:sdk-node
priority:p2
Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
What happened?
Steps to Reproduce
Configure env vars to any kind of trace exporter.
Use the NodeSDK and configure a custom context manager via the ctor.
Expected Result
custom context manager is used
Actual Result
custom context manager is not used
Additional Details
When setting a span processor or trace exporter via the NodeSDK ctor, this causes an internal TracerProvider config to be eagerly created. In this case, the context manager is copied over from the SDK config to the created TracerProvider config. Later, in the start call, this config is respected when registering the tracer provider by getting the context manager from the config object and passing it on to the register call.
When NOT setting a span processor or trace exporter, no config object is eagerly created. In this case, the register call does not check the config of the SDK (where the context manager would be) but passes on no context manager at all.
OpenTelemetry Setup Code
package.json
Relevant log output
No response
The text was updated successfully, but these errors were encountered: