open-telemetry / opentelemetry-java-instrumentation

OpenTelemetry auto-instrumentation and instrumentation libraries for Java
https://opentelemetry.io
Apache License 2.0
1.88k stars 823 forks source link

Allow overriding propagation of tracing headers #8786

Closed giovanniberti closed 1 year ago

giovanniberti commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.

Azure API Management without Diagnostic Logs enabled injects traceparent headers with the sampling flag set to 0. This causes the agent to not emit traces on instrumented services, and there's no easy way to override this behaviour from APIM without enabliing Diagnostic Logs.

Describe the solution you'd like A clear and concise description of what you want to happen.

I would like a configuration option to allow the agent to ignore incoming tracing headers, like this option on the Elastic APM.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

An alternative would be to use AlwaysOn sampler, but I'd rather have something more fine-grained if possible :)

Additional context Add any other context or screenshots about the feature request here.

mateuszrzeszutek commented 1 year ago

Related links: https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/8038, https://github.com/open-telemetry/opentelemetry-specification/issues/1633

trask commented 1 year ago

hi @giovanniberti! you could use a java agent extension to provide your own sampler which is not "parent based" (i.e. ignores the traceparent sampling flag)

github-actions[bot] commented 1 year ago

This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed automatically if there is no response from the author within 7 additional days from this comment.