Idea: expose query stats in Grafana #10192
Labels
component/query-frontend
enhancement
New feature or request
good first issue
Good for newcomers
squad/query
What is the problem you are trying to solve?
The query-frontend already keeps track of aggregated query stats. Grafana has a "Stats" tab in the "Query Inspector" view. The graphite datasource already uses that tab to feed some stats back to the user. We should expose (most of) the existing query stats in that pane.
These stats helps users fine-tune queries or spot underscaled Mimir clusters by looking at shardability, volume of data touched, time spent in the queue, and time spent encoding the result.
Existing query stats
Which solution do you envision (roughly)?
Format
The query-frontend results each query stat in the
Server-Timing
header. The same header is already used for some statistics. We can publish all relevant query stats to the same header. For exampleConsiderations
The header above is 293 characters. For a lot of queries the header will comprise most of the HTTP response. We don't want to unnecessarily amplify data transfer at the query-frontend. For that I propose to include an optional request header. The query-frontend only includes these stats when requested to.
Stability
This is intended to be ultimately interpreted by humans. As such we can change the set of stats we expose or rename them without notice.
Have you considered any alternatives?
Use the "Mimir / Slow queries" dashboard to find query stats.
Any additional context to share?
How long do you think this would take to be developed?
Small (<= 1 month dev)
What are the documentation dependencies?
Update the HTTP reference to mention the additional header and the potential stats and the (lack of) stability guarantee.
Proposer?
No response
The text was updated successfully, but these errors were encountered: