Skip to content
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

Observability on external rate limit module #106

Open
Tracked by #40
eguzki opened this issue Oct 8, 2024 · 2 comments · May be fixed by #118
Open
Tracked by #40

Observability on external rate limit module #106

eguzki opened this issue Oct 8, 2024 · 2 comments · May be fixed by #118
Assignees

Comments

@eguzki
Copy link
Contributor

eguzki commented Oct 8, 2024

In order to be able to observe what is happening at runtime via tools such as prometheus and grafana being able to expose some metrics around the WASM module would be useful.

As initial suggest, Envoy external rate limit filter statistics module (source), exports the following:

Name Type Description
ok Counter Total under limit responses from the rate limit service
error Counter Total errors contacting the rate limit service
over_limit Counter total over limit responses from the rate limit service
failure_mode_allowed Counter Total requests that were error(s) but were allowed through because of failure_mode_deny set to false.

Note: even if Limitador (the external rate limiting service) exposes metrics like ok and over_limit, the metrics from the gateway are more reliable as they take into account external rate limiting service downtimes and timeouts.

Related #6

@eguzki
Copy link
Contributor Author

eguzki commented Oct 8, 2024

@slopezz ^^

@eguzki eguzki self-assigned this Oct 21, 2024
@eguzki eguzki linked a pull request Oct 25, 2024 that will close this issue
@eguzki eguzki linked a pull request Oct 25, 2024 that will close this issue
@david-martin
Copy link
Member

The proxy_wasm module has some functions to define and increment metrics (which I believe end up as 'stats' in envoy proxy)
I played around with it a little here https://github.com/david-martin/my-envoy-wasm-filter/blob/main/src/lib.rs#L1
The metrics can then be scraped on the /stats/prometheus endpoint.

I had looked into adding custom labels to metrics, but because it's backed by stats, it wasn't clear how to do that.
I think a solution is to rename the metric to include any extra labels, then use 'stats tags' configuration to parse them out of the name and into labels.
https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/metrics/v3/stats.proto#config-metrics-v3-statsconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants