http: add priority_load_shed extension filter for priority-based overload shedding#45039
http: add priority_load_shed extension filter for priority-based overload shedding#45039leosarra wants to merge 9 commits into
Conversation
188e40b to
122e61d
Compare
| /*/extensions/filters/http/local_ratelimit @mattklein123 @wbpcode | ||
| /*/extensions/filters/common/local_ratelimit @mattklein123 @wbpcode | ||
| # Priority load shed | ||
| /*/extensions/filters/http/priority_load_shed @kbaichoo @botengyao |
There was a problem hiding this comment.
not sure who to put here, I added the maintainers involved in the review of the original issue (@KBaichoo @botengyao) . Let me know if I need to change this
There was a problem hiding this comment.
Hi @leosarra, have you followed Envoy extension policy prior to implementing this extension?
ff0faeb to
70f7e3c
Compare
2084996 to
6f50d48
Compare
| reject_on_invalid_header_(config.reject_on_invalid_header()), | ||
| stats_(generateStats(stats_prefix, scope)) { | ||
| if (config.header_name().empty()) { | ||
| creation_status = absl::InvalidArgumentError("header_name must be non-empty"); |
There was a problem hiding this comment.
not sure if it makes sense to have a redundant validation in the code if the rules are already set in the proto. wdyt?
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
|
Failure in precheck looks unrelated to the changes, probably a flaky test |
d3663d7 to
6d3e244
Compare
Signed-off-by: Leonardo Sarra <leonardosarra96@gmail.com>
Signed-off-by: Leonardo Sarra <leonardosarra96@gmail.com>
Signed-off-by: Leonardo Sarra <leonardosarra96@gmail.com>
Signed-off-by: Leonardo Sarra <leonardosarra96@gmail.com>
Change-Id: Ica10811d9194789f25368fb2b9972dad5045aadb Signed-off-by: Leonardo Sarra <leonardosarra96@gmail.com>
Change-Id: I66569a0d2ba12f482fdde4642dd06aa70e4e8661 Signed-off-by: Leonardo Sarra <leonardosarra96@gmail.com>
Change-Id: I486cc4769aac0dca67ae4aa7b5e3b78f73ae76ae Signed-off-by: Leonardo Sarra <leonardosarra96@gmail.com>
Change-Id: Ie58ef7f7d4e04c38550c4e0ea2088567e6656b36 Signed-off-by: Leonardo Sarra <leonardosarra96@gmail.com>
Change reject_on_missing_header and reject_on_invalid_header from bool to google.protobuf.BoolValue so that individual data plane implementations can decide their own defaults when the fields are unset. Change-Id: I70c4231ea197b31acb56b0d5b875b4096af7a6c0 Signed-off-by: Leonardo Sarra <leonardosarra96@gmail.com>
6d3e244 to
c14914d
Compare
Commit Message: http: add priority_load_shed filter for priority-based overload shedding
Additional Description:
Adds a new alpha HTTP filter, envoy.filters.http.priority_load_shed, that maps a configured request header value into buckets and checks corresponding overload manager load shed points.
The filter reads a configured request header and treats its first value as the request priority. The priority value must be a non-negative integer. For example, a deployment could use a header such as
x-message-priority: 10or3gpp-Sbi-Message-Priority: 10, then configure integer ranges that classify priorities into different shedding policies.The parsed priority is mapped into configured priority buckets. Each bucket defines a half-open integer range, [start, end), and references an overload manager load shed point. If the parsed priority value falls within one of the configured bucket ranges and that bucket’s load shed point is currently active, the filter rejects the request locally using Envoy’s existing overload response behavior:
503 Service Unavailablewith the envoyoverloaded body.Requests are allowed to continue when:
missing-headerrejection is enabledinvalid-headerrejection is enabledThe filter also supports an optional default load shed point. When configured, it is used as a fallback for requests with missing, invalid, or unmatched priority values, allowing users to apply a baseline overload policy to otherwise unclassified traffic.
Note that this filter is much more configurable than the original proposal I had in the linked issue (especially when it comes to default bucket and the rejections config) , this was done in order to make it more flexible to accommodate use-cases that are not exactly the one that was described originally.
Risk Level: Low since the feature is implemented by an independent opt-in filter
Testing: Added unit and integration tests
Docs Changes: Added dedicated doc for the filter
Release Notes: Added mention in the release notes
Platform Specific Features: not present
Fixes #Issue: Close #43552