-
Notifications
You must be signed in to change notification settings - Fork 239
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: untraced only works with parent-based sampler #1412
Conversation
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.
Assuming linter errors are addressed.
I blame Copilot. |
We'll have to be careful with the version bumps when releasing this. We've added a method to the |
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.
Shouldn't we add a dependency on -common
to the sdk gemspec?
It's already there. |
🤦 Wow - it is indeed, I must have skipped over it when I was hunting for it. 🤦 |
The
untraced
helper currently only works when a parent-based sampler is installed. As an example, it will not suppress spans if theALWAYS_ON
sampler is installed.This fixes
untraced
to work regardless of the sampler. It does this by communicating via a privateContext
key. An additional helperuntraced?
is introduced to query the state of the key from theContext
. The SDKTracer#start_span
implementation is updated to check foruntraced?
before delegating either to the APITracer#start_span
method 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.