Feature request: add lane label to query related metrics
- Dominant language
- Java
- Stars
- 14.1k
- Forks
- 3.8k
- Avg merge
- 2d 58m
- Merged PRs (30d)
- 233
Description
### Description
I would like to see the `lane` label on the prometheus metrics for queries.
This will allow me to visualize the effectiveness and alert based on the usage of lanes.
Specifically when this issue gets tackled/integrated, it will become even more interesting: https://github.com/apache/druid/issues/6993
### Motivation
Right now we can't visualize our query lane usage and can only adjust configuration based on guesses or metrics that we would let our developers have our apps emit.
In the future we don't want to have to write these metrics on our own, when druid is the more sensible way to write these metrics.
**EDIT:** It seems that this should already be the case as per the docs here: https://druid.apache.org/docs/latest/operations/metrics/
However, even though i fired a manual query against a datasource with laning set up and got a result row, I couldn't see a druid_query_priority metric coming from either broker or router.
What i do see however is a druid_sqlquery_time metric, so my metric collection seems to work fine.
Demo Query used:
```shell
curl -X POST http://localhost:56713/druid/v2/sql \
-H "Content-Type: application/json" \
-d '{
"query": "SELECT * FROM wikipedia WHERE __time >= TIMESTAMP '\''2024-02-01 00:00:00'\'' LIMIT 1",
"context": {
"lane": "lane1"
}
}'
```
Contributor guide
Research direction
Start by reproducing the SQL request against the /druid/v2/sql endpoint with context.lane set to lane1, then inspect the emitted query metrics, especially druid_query_priority and druid_sqlquery_time. Done means query-related Prometheus metrics expose the lane label when a query uses a configured lane, with the behavior verified against the documented metrics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, prometheus
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100