pingcap / pingcap/tidb

Discover possibly unused metrics in pkg/metrics/metrics.go

Open
#64,063 0 comments 0 reactions 0 assignees View on GitHub
component/metrics type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
During a metrics scan in the codebase, the following metrics in pkg/metrics/metrics.go appear to be registered but are not otherwise used in the code:

- [ ] `BatchAddIdxHistogram` and `AddIndexScanRate`
- [ ] `DistSQLScanKeysHistogram` and `DistSQLScanKeysPartialHistogram`
- [ ] `StatsInaccuracyRate`
- [ ] `ValidateReadTSFromPDCount`
- [ ] `GCRegionTooManyLocksCounter`
- [ ] `HandleSchemaValidate`
- [ ] `BindingCacheHitCounter` and `BindingCacheMissCounter`

These metrics might be outdated. We should verify whether they are still actively used, if any usage calls are missing and need to be added, or whether they can be safely removed to reduce maintenance overhead.

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.