Skip to content

Commit

Permalink
router: make shadow requests inherit parent sampling decision by defa…
Browse files Browse the repository at this point in the history
…ult (#37874)

## Description

This PR changes the behavior of shadow request sampling so that if trace
sampling is not explicitly configured in the shadow policy, the shadow
request will inherit the parent's sampling decision.

After this change, sampling will follow the trace sampling policy of the
original request, which prevents oversampling when runtime sampling is
disabled.

**Fixes:** #37766

---

**Commit Message:** router: make shadow requests inherit parent sampling
decision by default
**Additional Description:**
**Risk Level:** Low
**Testing:** Added Unit Tests
**Docs Changes:** Added
**Release Notes:** Added

---------

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>

Mirrored from https://github.com/envoyproxy/envoy @ 8e44345df9cf304410112f00b474ed337ac5b395
  • Loading branch information
update-envoy[bot] committed Jan 13, 2025
1 parent 47cf799 commit 91d3804
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion envoy/config/route/v3/route_components.proto
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,10 @@ message RouteAction {
// value, the request will be mirrored.
core.v3.RuntimeFractionalPercent runtime_fraction = 3;

// Determines if the trace span should be sampled. Defaults to true.
// Specifies whether the trace span for the shadow request should be sampled. If this field is not explicitly set,
// the shadow request will inherit the sampling decision of its parent span. This ensures consistency with the trace
// sampling policy of the original request and prevents oversampling, especially in scenarios where runtime sampling
// is disabled.
google.protobuf.BoolValue trace_sampled = 4;

// Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header. Defaults to ``false``.
Expand Down

0 comments on commit 91d3804

Please sign in to comment.