diff --git a/internal/locate/region_cache.go b/internal/locate/region_cache.go index 6e733c888..6e02c1bc0 100644 --- a/internal/locate/region_cache.go +++ b/internal/locate/region_cache.go @@ -1902,7 +1902,7 @@ func (mu *regionIndexMu) insertRegionToCache(cachedRegion *Region, invalidateOld // and there is the synchronization time between the pd follower and the leader. // So we should check the epoch. if ok && (oldVer.GetVer() > newVer.GetVer() || oldVer.GetConfVer() > newVer.GetConfVer()) { - metrics.StaleRegionFromPDCounter.Inc() + metrics.TiKVStaleRegionFromPDCounter.Inc() logutil.BgLogger().Debug("get stale region", zap.Uint64("region", newVer.GetID()), zap.Uint64("new-ver", newVer.GetVer()), zap.Uint64("new-conf", newVer.GetConfVer()), zap.Uint64("old-ver", oldVer.GetVer()), zap.Uint64("old-conf", oldVer.GetConfVer())) diff --git a/internal/locate/sorted_btree.go b/internal/locate/sorted_btree.go index 020335ef3..31bfef9e0 100644 --- a/internal/locate/sorted_btree.go +++ b/internal/locate/sorted_btree.go @@ -113,7 +113,7 @@ func (s *SortedRegions) removeIntersecting(r *Region, verID RegionVerID) ([]*btr return false } if item.cachedRegion.meta.GetRegionEpoch().GetVersion() > verID.ver { - metrics.StaleRegionFromPDCounter.Inc() + metrics.TiKVStaleRegionFromPDCounter.Inc() logutil.BgLogger().Debug("get stale region", zap.Uint64("region", verID.GetID()), zap.Uint64("ver", verID.GetVer()), zap.Uint64("conf", verID.GetConfVer()), zap.Uint64("intersecting-ver", item.cachedRegion.meta.GetRegionEpoch().GetVersion())) diff --git a/metrics/metrics.go b/metrics/metrics.go index 400403522..29548afa8 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -117,7 +117,7 @@ var ( TiKVPipelinedFlushDuration prometheus.Histogram TiKVValidateReadTSFromPDCount prometheus.Counter TiKVLowResolutionTSOUpdateIntervalSecondsGauge prometheus.Gauge - StaleRegionFromPDCounter prometheus.Counter + TiKVStaleRegionFromPDCounter prometheus.Counter ) // Label constants. @@ -853,7 +853,7 @@ func initMetrics(namespace, subsystem string, constLabels prometheus.Labels) { Help: "The actual working update interval for the low resolution TSO. As there are adaptive mechanism internally, this value may differ from the config.", }) - StaleRegionFromPDCounter = prometheus.NewCounter( + TiKVStaleRegionFromPDCounter = prometheus.NewCounter( prometheus.CounterOpts{ Namespace: namespace, Subsystem: subsystem, @@ -957,7 +957,7 @@ func RegisterMetrics() { prometheus.MustRegister(TiKVPipelinedFlushDuration) prometheus.MustRegister(TiKVValidateReadTSFromPDCount) prometheus.MustRegister(TiKVLowResolutionTSOUpdateIntervalSecondsGauge) - prometheus.MustRegister(StaleRegionFromPDCounter) + prometheus.MustRegister(TiKVStaleRegionFromPDCounter) } // readCounter reads the value of a prometheus.Counter.