Skip to content

feat: expose Zipkin trace_context_option in EnvoyProxy tracing - #10113

Open
vladst3f wants to merge 4 commits into
envoyproxy:mainfrom
vladst3f:feature/expose-TraceContextOption
Open

vladst3f wants to merge 4 commits into
envoyproxy:mainfrom
vladst3f:feature/expose-TraceContextOption

Conversation

@vladst3f

Copy link
Copy Markdown

What this PR does / why we need it:

This PR exposes Envoy's Zipkin trace_context_option (Envoy >= v1.36). It adds an optional field, EnvoyProxy.spec.telemetry.tracing.provider.zipkin.traceContextOption:

  • UseB3 (behaviour when unset): B3 headers only. This is how it works today.
  • UseB3WithW3CPropagation: reads the trace context from B3 headers and falls back to the W3C traceparent header when B3 is missing. Sends both B3 and traceparent to upstreams.

Why: meshes such as Istio use the Zipkin tracer, which uses B3 headers. Browsers (e.g. Grafana Faro), OpenTelemetry SDKs and many frameworks use W3C Trace Context by default. Switching the gateway to the OpenTelemetry tracer doesn't help, because Envoy's OpenTelemetry tracer only handles W3C and would break B3 trace continuity into the mesh. Today, dual propagation can only be enabled with an EnvoyPatchPolicy on the listener's tracing config.

Changes:

  • API: ZipkinTracingProvider.TraceContextOption (*ZipkinTraceContextOption, values UseB3 / UseB3WithW3CPropagation, mirroring Envoy's names). There is no CRD default, so existing resources are unchanged.
  • Translator: maps the field to ZipkinConfig.TraceContextOption. When unset or UseB3, it resolves to USE_B3, Envoy's default. Generated xDS for existing configs doesn't change, so existing EnvoyPatchPolicies and extension servers are unaffected.
  • Tests: the tracing-zipkin xDS translator testdata now covers the new option.
  • Generated files: deepcopy, CRDs, API reference docs, Helm golden files.

Example:

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
  name: zipkin-w3c
spec:
  telemetry:
    tracing:
      provider:
        type: Zipkin
        backendRefs:
          - name: zipkin
            port: 9411
        zipkin:
          enable128BitTraceId: true
          traceContextOption: UseB3WithW3CPropagation

Which issue(s) this PR fixes:
Fixes #10112


PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.
  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.
  • API agreed first: If this PR contains API changes (changes under /api), the API was discussed and agreed before the implementation. The API change can be in a separate PR, or in the same PR, but the API must be agreed before implementation. N/A if this PR does not contain API changes. API proposed in Expose Zipkin trace_context_option (B3 + W3C traceparent propagation) #10112.
  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.) Locally, make gen-check shows no diff for this change and make lint passes, except lint.kube-api-linter, which can't load its plugin on macOS; none of its enabled rules apply here. TestTranslateXds/merge-backends-consistent-hash already fails on current main.
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes. xDS translator testdata (tracing-zipkin) updated.
  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR. N/A if this PR does not contain user-facing changes. API reference regenerated (site/content/en/latest/api/extension_types.md).
  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes. new_features/10112-zipkin-trace-context-option.md.
  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed. make gen-check shows no diff for this change.
  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/. Optional field, no default, no xDS change when unset.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

Signed-off-by: Vlad Stefanescu <vstefanescu@epo.org>
@netlify

netlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit fb88625
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6abbe01798f9770008c3c51d
😎 Deploy Preview https://deploy-preview-10113--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vladst3f
vladst3f marked this pull request as ready for review September 25, 2026 09:41
@vladst3f
vladst3f requested a review from a team as a code owner September 25, 2026 09:41
@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.42%. Comparing base (f1f4888) to head (fb88625).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10113   +/-   ##
=======================================
  Coverage   81.41%   81.42%           
=======================================
  Files         266      266           
  Lines       41300    41304    +4     
=======================================
+ Hits        33626    33631    +5     
+ Misses       7673     7672    -1     
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vladst3f

Copy link
Copy Markdown
Author

@zirain the failing checks are unrelated and also happen on the main branch. could you advise on what's needed for merging this ?
Thanks !

@zirain

zirain commented Sep 30, 2026

Copy link
Copy Markdown
Member

/retest

@zirain
zirain requested a review from a team September 30, 2026 09:00

This branch has not been deployed

No deployments
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.

Expose Zipkin trace_context_option (B3 + W3C traceparent propagation)

2 participants