envoyproxy/envoy

Matcher-based route config should support `runtime_fraction`

Open

#24,239 opened on Nov 29, 2022

View on GitHub
 (8 comments) (0 reactions) (0 assignees)C++ (5,373 forks)batch import
area/matchinghelp wanted

Repository metrics

Stars
 (27,997 stars)
PR merge metrics
 (Avg merge 8d) (378 merged PRs in 30d)

Description

Description: Currently XDS matcher in route configuration context can route based on headers only, but routing based on runtime_fraction is desired for gradual rollouts.

One way to implement is to expose streamId (or randomId) in HttpMatchingData alongside requestHeaders: https://github.com/envoyproxy/envoy/blob/4e40d6ad5f98cd3c86f1398bb8990b1d88bdfe92/envoy/http/filter.h#L1078-L1084

Then add RuntimeFractionMatchInput in addition to HttpRequestHeaderMatchInput, smth like:

message RuntimeMatchInput {
  // Sets input to `true` if runtime key is enabled and `false` otherwise.
  core.v3.RuntimeFractionalPercent runtime_fraction = 1;
}

And allow it as an input source for HTTP route configuration matcher (and maybe others as well, like RBAC, as I assume it also may want to have gradual rollout functionality).

Is it something which is acceptable to add to envoy?

Relevant Links: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_routing.html#routing-via-generic-matching

Contributor guide