-
Notifications
You must be signed in to change notification settings - Fork 5
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
Sampling only Remote Traces #100
Conversation
renaz6
commented
Feb 17, 2023
•
edited
Loading
edited
- By default, local traces are not sampled
- Configuration added so that local tracing can be turned on if desired
Documentation on |
sampler := sdktrace.ParentBased(sdktrace.NeverSample()) | ||
|
||
if sampleLocalTraces { | ||
sampler = sdktrace.ParentBased(sdktrace.AlwaysSample()) |
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.
I'm not sure if we should use AlwaysSample()
even if sampleLocalTraces
is configured to be true
. The documentation suggests not using this in production environments that see a lot of traffic, but I also doubt we'll see parent-less traces.
An alternative option is using TraceIDRatioBased()
(https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#TraceIDRatioBased) and only sending a percentage of traces through.
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.
If we split apart the choices a bit more we can let the user decide what they want without us needing to do much & we can expand/grow later.
Replace sampleLocalTraces
with:
sampling-strategy:
parent-initiated: ignore # [ignore (default), honor]
no-parent: never # [never (default), always, traceidratio, ...]
traceidratio: # For each sampler that needs inputs they get enumerated separately.
percentage: 15.5
Choosing the quietest mode (completely off) as defaults.
Until we need to add traceidratio
we can just know it goes here. I think @Sachin4403 may want:
sampling-strategy:
parent-initiated: honor
no-parent: always
We'll probably want to use:
sampling-strategy:
parent-initiated: honor
no-parent: never
We can add the traceidratio
later if someone wants/needs it.
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.
Taking care of this in #102
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.
Given Wes's comment, we can do a separate PR to address the separate choices.
SonarCloud Quality Gate failed. |