-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Feature Description
Background
At HubSpot we've wanted to add p99 query duration metrics to the vttablet, beyond what is available using the existing histogram durations here. Even though one can generate percentiles from a histogram, we've found that using the prometheus library on the backend to calculate p99 is more accurate, and its values aren't capped at 10s (the largest bucket).
We tried to upstream the raw p99 metrics in this PR, however it wasn't accepted. Additionally, that PR had the problem of being potentially incompatible with non-default or non-prometheus backends.
Description
As an alternative to adding specific metrics, we could add an interface hook in the query_executor.go. By default it would be nil and wouldn't do anything, but it would allow users like us to define the hook and process any query timing data they want, including us generating p99 with prometheus.
This is a bit nebulous, so see the forthcoming PR for what this looks like.
Use Case(s)
The use case we have for this is for generating p99 and median values for query durations using the prometheus library.