pingcap / pingcap/tidb

pkg/metrics: add query duration metric by resource group

Open
#67,843 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.