Skip to content

feat: support client and overall tracing sampling#9402

Open
Ri7ay wants to merge 6 commits into
envoyproxy:mainfrom
Ri7ay:client-overall-tracing-sampling
Open

feat: support client and overall tracing sampling#9402
Ri7ay wants to merge 6 commits into
envoyproxy:mainfrom
Ri7ay:client-overall-tracing-sampling

Conversation

@Ri7ay

@Ri7ay Ri7ay commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
This PR adds support for configuring Envoy tracing client_sampling and overall_sampling in addition to the existing random_sampling support.

Envoy Gateway already exposes samplingRate / samplingFraction, which maps to Envoy HCM random_sampling. This change adds new optional client and overall sampling settings so users
can control traces requested by clients and the final overall trace volume sent to collectors.

The PR updates:

  • EnvoyProxy tracing API with clientSamplingRate, overallSamplingRate, clientSamplingFraction, and overallSamplingFraction
  • BackendTrafficPolicy route tracing with clientSamplingFraction and overallSamplingFraction
  • IR and xDS translation for HCM and route-level tracing sampling
  • CEL validation, unit/golden tests, generated CRDs/docs/Helm outputs, and release notes

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


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.
  • 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.)
  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.
  • 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.
  • 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.
  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed.
  • 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/.
  • Codex review: Requested a Codex review and addressed all of its comments.
  • Copilot review: Requested a Copilot review and addressed all of its comments.

@Ri7ay Ri7ay requested a review from a team as a code owner July 1, 2026 21:27
@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit bc6de2a
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a47b83491e28a00081f96f7
😎 Deploy Preview https://deploy-preview-9402--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.

Signed-off-by: Zakhar Zakharov <zakhar.zakharov.zz16@gmail.com>
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.38%. Comparing base (dc73f48) to head (bc6de2a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9402      +/-   ##
==========================================
+ Coverage   75.33%   75.38%   +0.04%     
==========================================
  Files         252      252              
  Lines       41471    41481      +10     
==========================================
+ Hits        31243    31270      +27     
+ Misses       8115     8101      -14     
+ Partials     2113     2110       -3     

☔ 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.

@Ri7ay Ri7ay force-pushed the client-overall-tracing-sampling branch from c4b0557 to 5629244 Compare July 1, 2026 21:38
Comment thread api/v1alpha1/envoyproxy_tracing_types.go Outdated
Signed-off-by: Zakhar Zakharov <zakhar.zakharov.zz16@gmail.com>
@Ri7ay Ri7ay requested a review from zirain July 2, 2026 07:12

@zirain zirain left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, would be better if we could have e2e.

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.

Support configuring client_sampling and overall_sampling for tracing in EnvoyProxy

2 participants