apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
817 stars 270 forks source link

"429 Too Many Requests" not captured in `apollo_router_http_requests_total` metric #4274

Open abernix opened 1 year ago

abernix commented 1 year ago

When 429 Too Many Request's are triggered on account of limiting, they aren't counted in the apollo_router_http_request_total metric. Unsure if that is intentional or not, but it would be desirable to be able to capture and observe that metric somewhere. Is there a place to observe it separately, or is it meant to be included in the apollo_router_http_requests_total number?

frittentheke commented 2 months ago

@abernix I just looked into this metric in the context of subgraph requests and their status:

apollo_router_http_requests_total{status="429", subgraph="mytotallyswampedsubgraph", ...} and apparently these are also not counted. The metric appears on the first occurrences of 429 responses from the subgraph, but only with a value of 1 which is never incremented and stales out after a few minutes again.

Any chance this issue could be tackled?