pkg/metrics: add query duration metric by resource group
Open
type/enhancement
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
When `record-db-label = true`, `tidb_server_handle_query_duration_seconds` includes the `db` label. In clusters with many databases, this can create high metric cardinality.
Some alerting rules only need query duration split by `resource_group`. They do not need the `db` or `sql_type` dimensions, and they do not need a Grafana dashboard panel.
Add a query duration metric that keeps only the `resource_group` label, so alerting can avoid the extra cardinality from `db` and `sql_type`.
Contributor guide
Assessment
This issue has not been assessed yet.