Page MenuHomePhabricator

Log rate limits from rest-gateway in webrequests
Closed, DuplicatePublic

Description

In order to analyse rest-gateway rate limit responses in turnilo/superset:

  • Add a specific response header when rate limiting in envoy x-requestctl: int:rest-gateway
  • Determine if this gets logged automatically into webrequests by haproxy or if some additional logging logic is needed

x-requestctl header gets scrubbed at the edge on response.

Event Timeline

Clement_Goubert triaged this task as Medium priority.

I just filed T417780: rest gateway: include x-wmf-* headers in response, now I'm wondering if the two tasks should be combined, and if they are the same. Do we need a separate "rate limit was applied" header? Wouldn't status 429 already tell us that?

@HCoplin-WMF can you clarify? CC @JAllemandou

The x-requestctl I'm proposing would put it in the place we look for in Turnilo to understand what rate limit rules are applied and where. Given how it's currently used, I think a better format for it would be rg:${x-wmf-ratelimit-class} actually. This would match what we do for haproxy enforced rules hap:${rule_name}. @Joe any objections/thoughts about this?