-
Notifications
You must be signed in to change notification settings - Fork 539
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
feat(auto-instrumentations-node): add getPropagator to get propagators from environment #2232
Closed
pichlermarc
wants to merge
12
commits into
open-telemetry:main
from
dynatrace-oss-contrib:feat/get-propagator
Closed
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
44c77a0
feat(auto-instrumentations-node): add getPropagator to get propagator…
pichlermarc 6539808
fixup! feat(auto-instrumentations-node): add getPropagator to get pro…
pichlermarc 12148ba
Merge branch 'main' into feat/get-propagator
pichlermarc c67eda1
fixup! feat(auto-instrumentations-node): add getPropagator to get pro…
pichlermarc 8d9dda1
Merge branch 'main' into feat/get-propagator
pichlermarc d13fbdd
fix: lint
pichlermarc 000d917
Merge branch 'main' into feat/get-propagator
pichlermarc f8b4480
Update metapackages/auto-instrumentations-node/test/utils.test.ts
pichlermarc cf3bb0d
fix(auto-instrumenations-node): ensure that empty values, all space v…
pichlermarc 49c524e
Merge remote-tracking branch 'upstream/main' into feat/get-propagator
pichlermarc 1dbc804
fix: sync package-lock.json
pichlermarc 2f635ff
chore: fix formatting
pichlermarc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should empty string be treated as "use the default" as well? (That's what I infer from the language in this section: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#enum-value)
Also the spec mentions handling "none" as a value to say "no propagators": https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration
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.
Yes that's correct, good catch 🙂 I added that to the default case. cf3bb0d
Also good catch, it would've incorrectly logged that it's unkown before (the Propgator would still have been a no-op CompositePropagator with no sub-propgators, so I think that would've been spec compliant). I added an info log that lets the user know that
none
. Though I'm not sure what to do if there'snone
among other valid values so I've opted to still take the rest of the propagators in that case. My guess is that users would be least surpirsed if they settracecontext, none
and theW3CTraceContextPropagator
would be the one that gets set. cf3bb0dThere 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.
Some comparison points on "none" handling:
OTEL_NODE_RESOURCE_DETECTORS
handlesfoo,none,bar
and "none"opentelemetry-js-contrib/metapackages/auto-instrumentations-node/src/utils.ts
Lines 238 to 244 in caf7cb5
OTEL_TRACES_EXPORTER
is slightly weird:OTEL_TRACES_EXPORTER=none,otlp
results in different behaviour toOTEL_TRACES_EXPORTER=otlp,none
:) https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-sdk-node/src/TracerProviderWithEnvExporter.ts#L101-L126Anyway, this is something that could perhaps share some common processing at some point. Doesn't have to be this PR, and perhaps would wait for work related to supporting file-config.