Repository navigation
feat(propagators): honor upstream sampling decisions - #925
Open
CagriYonca wants to merge 1 commit into
Open
CagriYonca wants to merge 1 commit into
CagriYonca wants to merge 1 commit into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
CagriYonca
force-pushed
the
feat-sampling-suppression
branch
from
December 2, 2026 10:06
20ee2af to
3bceed1
Compare
Signed-off-by: Cagri Yonca <cagri@ibm.com>
CagriYonca
force-pushed
the
feat-sampling-suppression
branch
from
December 2, 2026 10:07
3bceed1 to
42818c2
Compare
This branch has not been deployed
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.
Problem
Without
X-INSTANA-L, the Python tracer ignored the sampled flag of an incomingtraceparent. Upstream tracers such as OpenTelemetry that rejected a trace (…-00) still got spans from us. Separately, when a trace was suppressed,BinaryPropagator(gRPC client, ASGI responses) leakedX-INSTANA-T/SandServer-Timing, andTextPropagatoralways wrote level1.What needed to be done
traceparentsampled flag whenX-INSTANA-Lis absent, as defined in the tracer specification.disable-w3c-sampled-flag-inheritance.X-INSTANA-T/SandServer-Timingfor suppressed traces, and keep the real level inTextPropagator.What was done
traceparentsampled flag of0now suppresses tracing whenX-INSTANA-Lis absent.X-INSTANA-T/Sdo not affect the level. The incoming parent-id is propagated downstream.tracing.global.disable-w3c-sampled-flag-inheritance, defaultfalse. Sources: envINSTANA_TRACING_DISABLE_W3C_SAMPLED_FLAG_INHERITANCE, YAML, agent config. When enabled, the flag is ignored,X-INSTANA-L: 1and…-01are sent, andthis removed from the outgoingottracestate entry.BinaryPropagatorandTextPropagatorskipX-INSTANA-T/SandServer-Timingwhen suppressed.TextPropagatorwrites the real level, andBinaryPropagatorwritestraceparenteven withouttracestate.traceparent …-00without Instana headers are now dropped. The option restores the old behavior.INSTANA_DISABLE_W3C_TRACE_CORRELATIONis set. The spec does not cover this and the question is open in the spec PR.How it was tested
pytest tests/propagators tests/test_options.py tests/util tests/w3c_trace_context: 468 passed.