fix: untraced only works with parent-based sampler#1412
Merged
Conversation
arielvalentin
approved these changes
Dec 9, 2022
Contributor
arielvalentin
left a comment
There was a problem hiding this comment.
Assuming linter errors are addressed.
Contributor
Author
I blame Copilot. |
Contributor
Author
|
We'll have to be careful with the version bumps when releasing this. We've added a method to the |
ahayworth
reviewed
Dec 9, 2022
Contributor
ahayworth
left a comment
There was a problem hiding this comment.
Shouldn't we add a dependency on -common to the sdk gemspec?
Contributor
Author
It's already there. |
Contributor
🤦 Wow - it is indeed, I must have skipped over it when I was hunting for it. 🤦 |
ahayworth
approved these changes
Dec 9, 2022
arielvalentin
approved these changes
Dec 12, 2022
robertlaurin
approved these changes
Dec 12, 2022
robbkidd
approved these changes
Dec 20, 2022
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
untracedhelper currently only works when a parent-based sampler is installed. As an example, it will not suppress spans if theALWAYS_ONsampler is installed.This fixes
untracedto work regardless of the sampler. It does this by communicating via a privateContextkey. An additional helperuntraced?is introduced to query the state of the key from theContext. The SDKTracer#start_spanimplementation is updated to check foruntraced?before delegating either to the APITracer#start_spanmethod or toTracerProvider#internal_start_span.The OpenTelemetry JS implementation offers the same functionality implemented in the same way, and serves as inspiration for the implementation in this PR.