Page MenuHomePhabricator

[API Gateway] Get insight into proxy time for Envoy
Closed, DeclinedPublic

Description

We need to get additional insight into Envoy's proxy time - to be specific, the sum of times

  • between a request arriving and being sent to the upstream
  • between a response being received from the upstream and the full response being sent to the downstream

There are additional complications to be considered in terms of how filters and things like rate limiting service impacts these times, but for the purposes of our exercise we don't necessarily care about the nuances of these as long as we get raw values for the above.

These statistics should be available via Prometheus as a histogram (our ultimate goal being calculating the 99th percentile of proxy times).

I have spent a long time looking at existing metrics and trying to ascertain whether we can get this from existing metrics but it seems like this functionality does not exist, and that any results we'd approximate from existing histograms (for example trying to juggle the existing upstream and downstream time histograms) would be inaccurate.

Currently our response time SLI is the time from request to response of API content to the user. This means that our response time is bound by the response time of the appservers, databases and other components along the path. This is correct from the perspective of the API server being an application rather than a proxy. Our response time SLIs would be a lot lower and more useful by being independent of these factors and encompassing the real amount of time taken to serve requests.

Event Timeline

Aklapper renamed this task from Get insight into proxy time for Envoy to [API Gateway] Get insight into proxy time for Envoy .Apr 1 2024, 8:09 AM

As API Gateway is nowadays owned by ServiceOps, adding the ServiceOps project tag to open API Gateway tasks tagged with the deprecated/archived "Platform Team Initiatives (API Gateway)" tag at https://phabricator.wikimedia.org/project/profile/4321/, as part of Phabricator Housekeeping.

@hnowlan: Removing task assignee as this open task has been assigned for more than two years - see the email sent to all task assignees on 2024-04-15.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!

Krinkle subscribed.

Closing tasks for the former "API Gateway". See also https://wikitech.wikimedia.org/wiki/API_Gateway.

fwiw this metric would also be useful for the rest-gateway - there might have been metrics added to envoy since that would enable this. For the time being though I see no need to re-open this issue