-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
OTEL_TRACES_SAMPLER env var does not seem to be respected by OTLP tracing #5947
Comments
Do we just have to remove the sampler?? @gburek-fastly |
May I pick this up? |
@jatinagwal that appears to be the case, but I think it loses the It seems the original author was trying to do something like using a custom attr as a context propagation scheme, but it is always ignored due to the sampler here being hardcoded to always sample? Functionally, removing the sampler will preserve existing default behavior and allow for env vars to configure the sampler, but it will not restore or implement the attr based propagation behavior. |
@vishal-chdhry are you working on this |
@johurul000 I believe @jatinagwal is |
@jatinagwal let us know if you managed to put some work into this issue 🙃, otherwise we could ask someone else, would be good to have this fixed ASAP. |
Hey, @matej-g , I am little confused about migration.ForceTracingAttributeKey . @vishal-chdhry you can pick this up. If I found something useful, will share here. |
@jatinagwal have you found anything more about the migration.ForceTracingAttributeKey. |
We should definitely not have the sampler hardcoded to always, but I think we should add this to the That being said, yes, removing the hardcoded sampler would allow for setting it via env but we would need to account somehow for the override sampler. As for the 'ForceTracingAttributeKey' and override sampler, this is for backwards compatibility reasons, since this feature existed before moved to OpenTelemetry. |
I want to work on this. |
Can this be closed following the merge of #6306? |
Looks like there are couple more missing pieces as per my comment in #6306 (review), but the issue at hand should be resolved, so we can close this. |
Thanos, Prometheus and Golang version used:
Object Storage Provider: GCP
What happened:
When tracing was configured with:
and the process was running with env var
OTEL_TRACES_SAMPLER="alwaysoff"
traces continued to be emitted.What you expected to happen:
The OTLP SDK should respond to env vars like
OTEL_TRACES_SAMPLER
andOTEL_TRACES_SAMPLER_ARG
as detailed inhttps://opentelemetry.io/docs/reference/specification/sdk-environment-variables/#general-sdk-configuration
How to reproduce it (as minimally and precisely as possible):
Run thanos 0.29.0 with
--tracing.config-file=/etc/thanos/tracing.yml
andtracing.yaml
ofAnything else we need to know:
It appears that the sampler is hard coded as
tracesdk.ParentBased(tracesdk.TraceIDRatioBased(1.0))
andtracesdk.WithSampler
As documented in https://pkg.go.dev/go.opentelemetry.io/otel/sdk/trace#WithSampler:
Since the effective behavior of the sampler where
ParentBased(tracesdk.TraceIDRatioBased(1.0))
is equivalent toParentBased(AlwaysSample)
, removing the sampler in the code will have no effective change in the default behavior, but would allow env var configuration to occur.The text was updated successfully, but these errors were encountered: