-
Notifications
You must be signed in to change notification settings - Fork 762
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(sdk-node): fix exporter to be read only OTEL_TRACES_EXPORTER is set to a valid exporter #3492
fix(sdk-node): fix exporter to be read only OTEL_TRACES_EXPORTER is set to a valid exporter #3492
Conversation
…mpty Signed-off-by: Svetlana Brennan <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3492 +/- ##
==========================================
- Coverage 93.78% 93.41% -0.37%
==========================================
Files 249 228 -21
Lines 7612 6334 -1278
Branches 1587 1351 -236
==========================================
- Hits 7139 5917 -1222
+ Misses 473 417 -56 |
Signed-off-by: Svetlana Brennan <[email protected]>
…nan/opentelemetry-js into fix-default-tracer-from-env
The two failing tests are related to the karma server:
|
packages/opentelemetry-sdk-trace-base/test/common/BasicTracerProvider.test.ts
Outdated
Show resolved
Hide resolved
The browser tests are failing: (https://github.com/open-telemetry/opentelemetry-js/actions/runs/3708747298/jobs/6286637020)
When running the browser tests locally, use node.js v16 instead of a higher version: https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thank you for fixing this! 🙂
Once we have the Browser tests working this should be good to go, I have put a suggestion in the comments 🙂
packages/opentelemetry-sdk-trace-base/test/common/BasicTracerProvider.test.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Svetlana Brennan <[email protected]>
…mpty
Signed-off-by: Svetlana Brennan [email protected]
Which problem is this PR solving?
BasicTracerProvider
was attempting to read exporter from env (by using__buildExporterFromEnv
) becauseOTEL_TRACES_EXPORTER
default value was changed from "none" to "otlp" in this pr. .So this pr fixes that issue by changing
OTEL_TRACES_EXPORTER
to default value of "". But this also affectsTracerProviderWithEnvExporters
class which is used by theNodeSDK
so the necessary logic has to be changed to now handleOTEL_TRACES_EXPORTER
default value set to "".Fixes # (#3449) and (#3422)
Short description of the changes
OTEL_TRACES_EXPORTER
default value set to ""__buildExporterFromEnv
inBasicTracerProvider
now doesn't set up an exporter ifOTEL_TRACES_EXPORTER
is "" and instead creates a NoopSpanProcessor.TracerProviderWithEnvExporters
now sets up an OTLP exporter as the default exporter whenOTEL_TRACES_EXPORTER
is set to "". Previously it didn't set up any exporters whenOTEL_TRACES_EXPORTER
was set to "".BasicTracerProvider
. See issues tracer provider always attempts to read exporter from env #3449 and OTEL_TRACES_EXPORTER default value incompatible with @opentelemetry/sdk-trace-base #3422Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: