Skip to content

tracing: make otel tracer respect envoy tracing decision - #45830

Merged
yanavlasov merged 1 commit into
mainfrom
fix-tracer
Jun 24, 2026
Merged

yanavlasov merged 1 commit into
mainfrom
fix-tracer

Conversation

@mattklein123

Copy link
Copy Markdown
Member

Previously this was ignored and the parent sampling status was taken no matter the internal decision.

Fixes #35721

Previously this was ignored and the parent sampling status was taken no
matter the internal decision.

Fixes #35721

Signed-off-by: Matt Klein <[email protected]>
@mattklein123
mattklein123 requested a review from yanavlasov as a code owner June 24, 2026 18:44
@yanavlasov
yanavlasov merged commit d8aba31 into main Jun 24, 2026
28 checks passed
eottabom added a commit to eottabom/envoy that referenced this pull request Nov 26, 2026
…y tracer

Since envoyproxy#45830 the OpenTelemetry tracer applies Envoy's tracing decision as a
final veto even when a valid parent span context is extracted. With
random_sampling below 100%, requests with a sampled traceparent are dropped
at the random_sampling rate.

The HCM now reports whether a NotTraceable request was only not selected by
random sampling and passes overall sampling (Tracing::Decision::
parent_sampling_allowed). The new opt-in OpenTelemetryConfig field
honor_parent_sampling_decision keeps the parent's sampling decision in that
case. Overall sampling and client sampling rejections, missing or invalid
request IDs and health checks still veto. The default behavior is unchanged.

Fixes envoyproxy#49638

Signed-off-by: eottabom <[email protected]>
eottabom added a commit to eottabom/envoy that referenced this pull request Nov 26, 2026
…y tracer

Since envoyproxy#45830 the OpenTelemetry tracer applies Envoy's tracing decision as a
final veto even when a valid parent span context is extracted. With
random_sampling below 100%, requests with a sampled traceparent are dropped
at the random_sampling rate, and the traceparent injected upstream carries
the vetoed sampled flag.

The HCM now reports, in Tracing::Decision::parent_sampling_allowed, whether
in its own evaluation random sampling did not select the request, client
sampling did not reject it, and it passes overall sampling. The new opt-in
OpenTelemetryConfig field honor_parent_sampling_decision keeps the parent's
sampling decision in that case. Overall sampling and client sampling
rejections, missing or invalid request IDs and health checks still veto.
The default behavior is unchanged.

Fixes envoyproxy#49638

Signed-off-by: eottabom <[email protected]>
eottabom added a commit to eottabom/envoy that referenced this pull request Nov 26, 2026
…y tracer

Since envoyproxy#45830 the OpenTelemetry tracer applies Envoy's tracing decision as a
final veto even when a valid parent span context is extracted. With
random_sampling below 100%, requests with a sampled traceparent are dropped
at the random_sampling rate, and the traceparent injected upstream carries
the vetoed sampled flag.

The HCM now reports, in Tracing::Decision::parent_sampling_allowed, whether
in its own evaluation random sampling did not select the request, client
sampling did not reject it, and it passes overall sampling. The HCM only
sets the flag when the reason is NotTraceable.

The new opt-in OpenTelemetryConfig field honor_parent_sampling_decision lifts
Envoy's veto in that case when the parent span context is sampled. A
configured sampler can still drop the span, but it cannot sample a span
whose parent is not sampled. Overall sampling and client sampling
rejections and missing or invalid request IDs still veto. Requests that the
health check filter marks only after the span is started are not
distinguished. The default behavior is unchanged.

Fixes envoyproxy#49638

Signed-off-by: eottabom <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
eottabom added a commit to eottabom/envoy that referenced this pull request Nov 26, 2026
…y tracer

Since envoyproxy#45830 the OpenTelemetry tracer applies Envoy's tracing decision as a
final veto even when a valid parent span context is extracted. With
random_sampling below 100%, requests with a sampled traceparent are dropped
at the random_sampling rate, and the traceparent injected upstream carries
the vetoed sampled flag.

The HCM now reports, in Tracing::Decision::parent_sampling_allowed, whether
in its own evaluation random sampling did not select the request, client
sampling did not reject it, and it passes overall sampling. The HCM only
sets the flag when the reason is NotTraceable.

The new opt-in OpenTelemetryConfig field honor_parent_sampling_decision lifts
Envoy's veto in that case when the parent span context is sampled. A
configured sampler can still drop the span, but it cannot sample a span
whose parent is not sampled. Overall sampling and client sampling
rejections and missing or invalid request IDs still veto. Requests that the
health check filter marks only after the span is started are not
distinguished. The default behavior is unchanged.

Fixes envoyproxy#49638

Signed-off-by: eottabom <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opentelemetry tracing provider doesn't respect client_sampling when both traceparent and x-client-trace-id header is present

3 participants