Skip to content

Commit

Permalink
add const label for metrics (tikv#781)
Browse files Browse the repository at this point in the history
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
  • Loading branch information
zeminzhou committed Feb 28, 2024
1 parent 3822d4c commit a0d1c09
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,26 +704,29 @@ func initMetrics(namespace, subsystem string, constLabels prometheus.Labels) {

TiKVStaleReadCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "stale_read_counter",
Help: "Counter of stale read hit/miss",
Namespace: namespace,
Subsystem: subsystem,
Name: "stale_read_counter",
Help: "Counter of stale read hit/miss",
ConstLabels: constLabels,
}, []string{LblResult})

TiKVStaleReadReqCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "stale_read_req_counter",
Help: "Counter of stale read requests",
Namespace: namespace,
Subsystem: subsystem,
Name: "stale_read_req_counter",
Help: "Counter of stale read requests",
ConstLabels: constLabels,
}, []string{LblType})

TiKVStaleReadBytes = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "stale_read_bytes",
Help: "Counter of stale read requests bytes",
Namespace: namespace,
Subsystem: subsystem,
Name: "stale_read_bytes",
Help: "Counter of stale read requests bytes",
ConstLabels: constLabels,
}, []string{LblResult, LblDirection})

initShortcuts()
Expand Down

0 comments on commit a0d1c09

Please sign in to comment.