-
Notifications
You must be signed in to change notification settings - Fork 642
feat: xds policy metadata #7824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
8f8a034 to
22d1677
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7824 +/- ##
=======================================
Coverage 72.75% 72.76%
=======================================
Files 235 235
Lines 35100 35142 +42
=======================================
+ Hits 25537 25570 +33
- Misses 7748 7755 +7
- Partials 1815 1817 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
22d1677 to
7734d4f
Compare
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
7734d4f to
f625688
Compare
|
cc @guydc is there any prior art for policy related metadata |
|
Hi,
|
| SectionName string `json:"sectionName,omitempty" yaml:"sectionName,omitempty"` | ||
|
|
||
| // TrafficPolicy is the NamespacedName of the TrafficPolicy resource associated with this resource | ||
| // If merged with parent policy, users need to check the status to find more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can resuse the |
|
hey we discussed this in the community meeting this week, this is a great feature but hoping you can give more clarity on the use case
|
|
Generally, the user case is to find out the policy(we can add Security Policy) applied to the route when client received a non 200 resposne. |
|
For that specific case, shouldnt the metadata be on the RBAC filter ? |
RBAC is for 4xx, and 429 for ratelimit. this'a a general solution for any xPolicy, either from Envoy Gateway Extensions or Gateway API BTW, can you elaborate a little more about set metadata to the RBAC filter? |
|
Now, the Envoy have supported a filter state to record the filter name that return the local response ( Anyway, for now, there is no general way to attach additional metadata for single Although part of our filters support metadata in their configuration, but it's implementation detail of the filter and Envoy's core will not aware it. Or in the future, we can try the envoyproxy/envoy#42912, which could provide the actual per route filter, then, the plugin name could be used to map the policy name directly. |
This's an alternative for #6801, users should be able to dump the policies applied to the route with command
%METADATA(ROUTE:envoy-gateway:policies)%.This will help users to find which policy cause 429 response.
Sample output as following:
{ ":authority": "172.18.255.201", "authorization": null, "bytes_received": 0, "bytes_sent": 0, "downstream_local_address": "10.244.2.26:10080", "downstream_remote_address": "172.18.0.1:55720", "duration": 2, "method": "GET", "policies": [ { "kind": "BackendTrafficPolicy", "name": "policy-httproute", "namespace": "default" } ], "protocol": "HTTP/1.1", "ratelimit": { "descriptors": [ { "entries": [ "httproute/default/http-ratelimit/rule/0/match/0/*=httproute/default/http-ratelimit/rule/0/match/0/*", "rule-0-match-0=rule-0-match-0" ] } ], "domain": "default/eg/http" }, "request_headers_bytes": 224, "requested_server_name": null, "response_code": 429, "response_code_details": "request_rate_limited", "response_flags": "RL", "route_name": "httproute/default/http-ratelimit/rule/0/match/0/*", "start_time": "2025-12-30T03:23:15.726Z", "upstream_cluster": "httproute/default/http-ratelimit/rule/0", "upstream_duration": null, "upstream_host": null, "upstream_local_address": null, "upstream_transport_failure_reason": null, "user-agent": "curl/8.7.1", "x-envoy-origin-path": "/echo", "x-envoy-upstream-service-time": null, "x-forwarded-for": "172.18.0.1", "x-request-id": "551f54cd-e7f3-49f8-a574-fcda06bceab0" }