Skip to content

Commit

Permalink
cluster: Lower sync config log level (#4929)
Browse files Browse the repository at this point in the history
close #4923

Signed-off-by: bufferflies <1045931706@qq.com>
  • Loading branch information
bufferflies committed May 16, 2022
1 parent eed19e0 commit f1d026e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,11 @@ func syncConfig(manager *config.StoreConfigManager, stores []*core.StoreInfo) bo
// it will try next store if the current store is failed.
address := netutil.ResolveLoopBackAddr(stores[index].GetStatusAddress(), stores[index].GetAddress())
if err := manager.ObserveConfig(address); err != nil {
log.Warn("sync store config failed, it will try next store", zap.Error(err))
storeSyncConfigEvent.WithLabelValues(address, "fail").Inc()
log.Debug("sync store config failed, it will try next store", zap.Error(err))
continue
}
storeSyncConfigEvent.WithLabelValues(address, "succ").Inc()
// it will only try one store.
return true
}
Expand Down
9 changes: 9 additions & 0 deletions server/cluster/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ var (
Help: "The current progress of corresponding action",
}, []string{"address", "store", "action"})

storeSyncConfigEvent = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "pd",
Subsystem: "cluster",
Name: "store_sync",
Help: "The state of store sync config",
}, []string{"address", "state"})

storesETAGauge = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "pd",
Expand All @@ -117,4 +125,5 @@ func init() {
prometheus.MustRegister(bucketEventCounter)
prometheus.MustRegister(storesProgressGauge)
prometheus.MustRegister(storesETAGauge)
prometheus.MustRegister(storeSyncConfigEvent)
}

0 comments on commit f1d026e

Please sign in to comment.