envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Add the ability to set the hits_addend for a given rate_limit request via a hardcoded dynamic metadata field

Open EItanya opened this issue 1 year ago • 7 comments

Commit Message: Adds the ability to set the hits_addend for a given rate_limit request via a hardcoded dynamic metadata field: envoy.ratelimit:hits_addend. Additional Description: Risk Level: Low Testing: Added unit test. I have also manually tested this using gloo-edge as the control-plane. Docs Changes: Release Notes: Platform Specific Features: N/A [Optional Runtime guard:] N/A [Optional Fixes #Issue] N/A [Optional Fixes commit #PR or SHA] N/A [Optional Deprecated:] N/A [Optional API Considerations:] N/A

EItanya avatar May 16 '24 02:05 EItanya

As a reminder, PRs marked as draft will not be automatically assigned reviewers, or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

:cat:

Caused by: https://github.com/envoyproxy/envoy/pull/34184 was opened by EItanya.

see: more, trace.

The changes to ratelimit.cc are meant mostly as a conversation starter. I originally debated adding a MetadataKey to the Route spec to be able to generically specify a metadata key, but that felt overkill for such a small feature so I decided to start here. I can also of course make envoy.ratelimit a constant a la envoy.lb, but I wasn't sure of the appetite for that.

I'm also not sure exactly where the docs should live for this feature. I definitely think that updating the release notes make sense and I can do that, but it could definitely also make sense to add it to the proper docs.

EItanya avatar May 16 '24 02:05 EItanya

At a high level this seems fine to me. For documentation I would add to the filter specific documentation as well as the release notes.

/wait

mattklein123 avatar May 20 '24 14:05 mattklein123

Ok, I'll add the documentation, are there any code changes you'd like me to make while I'm at it?

EItanya avatar May 20 '24 19:05 EItanya

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/). envoyproxy/api-shepherds assignee is @mattklein123 CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

:cat:

Caused by: https://github.com/envoyproxy/envoy/pull/34184 was synchronize by EItanya.

see: more, trace.

/retest

jmarantz avatar May 30 '24 16:05 jmarantz

format failure

/wait

jmarantz avatar May 30 '24 21:05 jmarantz

@jmarantz is there a good way to ensure all of my tools are up to date? When I run formatting it comes up with no diff. Or potentially does the CI job have the diff I need to apply?

EItanya avatar Jun 03 '24 15:06 EItanya

/wait

wbpcode avatar Jun 11 '24 02:06 wbpcode

@wbpcode and @mattklein123 I have updated the PR to use filter_state instead of dynamic_metadata. Can you please take another look

EItanya avatar Jul 25 '24 18:07 EItanya

Responded to all comments, thanks for reviewing and re-assigning.

EItanya avatar Jul 29 '24 12:07 EItanya