Add enableContextPropagation field to Telemetry Tracing API#3645
Add enableContextPropagation field to Telemetry Tracing API#3645prashanthjos wants to merge 2 commits intoistio:masterfrom
Conversation
Adds a new field `enable_context_propagation` to the Tracing message that allows users to disable trace context header propagation independently from span reporting. This enables use cases like egress gateways where trace headers (X-B3-*, traceparent, etc.) should not be forwarded to external services while still maintaining internal observability.
|
🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test? Courtesy of your friendly test nag. |
|
how would this work? can you elaborate? |
|
@zirain this is my current thought process, do let me know if you see any issue: Since Envoy's tracing providers don't have a native "disable propagation" option, the implementation in istiod would need to:
This is similar to how VirtualService header manipulation works, but applied automatically based on the Telemetry config. Tracing remains enabled (spans are reported), but the headers are stripped before the request leaves the proxy. I will dive deeper once I get to implementation. |
|
so that means a Telemetry API will affect route? |
|
Yes, the Telemetry API would affect route configuration when enableContextPropagation: false. ( I will get better idea once I start coding the changes, but this is the idea for now) Since Envoy's tracing providers don't have a native "disable propagation only" option (they always propagate headers when tracing is enabled), the implementation would need to add request header removal to the route config to strip trace context headers before forwarding upstream. This is similar to how:
The Telemetry API already influences multiple parts of Envoy config (HCM tracing, filters, etc.). This would extend that to route-level header manipulation when context propagation needs to be disabled. |
|
They wouldn't change the Then I would like to say |
|
@zirain are you suggesting changes to envoy, before making Istio changes? |
Yes, that's what I thought. |
|
I understand, let me see if I can try making changes to envoy before moving forward. |
Description
This PR adds a new
enableContextPropagationfield to the Telemetry API's Tracing configuration.Problem
Currently, there is no way to disable trace context propagation without also disabling span reporting. Users who want to prevent trace headers from being forwarded to external services (e.g., at egress gateways) must use workarounds like:
disableSpanReporting: true(which loses observability)Solution
Add
enableContextPropagation(defaults totrue) to the Tracing config. When set tofalse:X-B3-*,traceparent,tracestate, etc.) are not propagated in forwarded requestsExample Usage
fixes #58871