Add unit multiplier#552
Conversation
8b1180a to
a3d4960
Compare
a3d4960 to
d6cef5f
Compare
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Not stale. Still waiting for input from e.g. @mattklein123 |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Still waiting for input. |
|
Hello @harpunius thanks It appears that one check were not successful. |
|
@harpunius are you actively working on this? If not we would like to contribute this as this is needed for us |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Not stale, still waiting for input envoyproxy/envoy#33277. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Not stale |
|
@harpunius is draft still the correct status of this PR? |
Signed-off-by: Tobias Sommer <harpunius@gmail.com>
Signed-off-by: Tobias Sommer <harpunius@gmail.com>
d6cef5f to
46aae3b
Compare
|
Hey, thanks for your input and interest in this PR. As mentioned in the PR description:
For my implementation we need to extend the ratelimit protobuf definitions linked above. Tests run locally by statically linking the fixed protobuf files (with the new field added, see the issue in envoyproxy/envoy). Unfortunately, I don't see a way around that due to how the ratelimit envoy filter communicates with the ratelimit service. I opened an issue to track this, but I still haven't gotten a response from the maintainers. I'm not very skilled with c++, so I'm having a hard time figuring out what additional work is needed in envoyproxy/envoy, for instance https://github.com/envoyproxy/envoy/blob/f580ed067db0f2a48085aa33e45a3a9cf5e36bfe/source/extensions/filters/http/ratelimit/ratelimit_headers.cc#L32 also needs to reflect the unit multiplier. I did rebase so there at least aren't merge conflicts any more :) |
|
ah, I see. Makes sense. Let me see if I can move the envoy piece. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Still waiting for input for envoyproxy/envoy#33277. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Still waiting for input. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
not stale. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
@Pawan-Bishnoi what happened w/ the envoy proto change? This would be a very nice feature to have in the "reference" implementation. |
|
I spent some time last weekend but the devContainer build was failing and ended up spending the whole day on that. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
not stale: envoyproxy/envoy#38529 |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Not stale. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This seemed like a nice feature. Let's me say per 30 minutes or similar. Is there work needed on this to get it in? |
|
yes. This work: envoyproxy/envoy#38529 I am struggling to find time for this 😄 |
Implements the unit multiplier idea suggested in #190.
I chose to force unit multiplier to 1 if the value is unset to avoid if/else checks whenever we rely on the value or log anything. This means the PR got slightly bigger than intended, but I think it's nicer.
The config parser panics if
unit_multiplier: 0is set. One RFC is the TODO inUnitToDividerWithMultiplierwhere I added a redundant if-zero runtime check to make sure we don't multiply by zero and effectively disable the rate limiting.Note, this is a draft and doesn't build due to the dependencies on both https://github.com/envoyproxy/go-control-plane/blob/main/envoy/service/ratelimit/v3/rls.pb.go#L357-L367 and https://github.com/envoyproxy/go-control-plane/blob/main/ratelimit/config/ratelimit/v3/rls_conf.pb.go#L246-L263. I opened an issue to track this: envoyproxy/envoy#33277.
I couldn't run the integration tests locally (WSL setup) so let me know if we need to extend those tests as well.
Happy to hear your thoughts.