github.com/pingcap/br@v5.3.0-alpha.0.20220125034240-ec59c7b6ce30+incompatible/pkg/backup/metrics.go (about)

     1  // Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0.
     2  
     3  package backup
     4  
     5  import (
     6  	"github.com/prometheus/client_golang/prometheus"
     7  )
     8  
     9  var (
    10  	backupRegionCounters = prometheus.NewCounterVec(
    11  		prometheus.CounterOpts{
    12  			Namespace: "br",
    13  			Subsystem: "raw",
    14  			Name:      "backup_region",
    15  			Help:      "Backup region statistic.",
    16  		}, []string{"type"})
    17  
    18  	backupRegionHistogram = prometheus.NewHistogram(
    19  		prometheus.HistogramOpts{
    20  			Namespace: "br",
    21  			Subsystem: "raw",
    22  			Name:      "backup_region_seconds",
    23  			Help:      "Backup region latency distributions.",
    24  			Buckets:   prometheus.ExponentialBuckets(0.05, 2, 16),
    25  		})
    26  )
    27  
    28  func init() { // nolint:gochecknoinits
    29  	prometheus.MustRegister(backupRegionCounters)
    30  	prometheus.MustRegister(backupRegionHistogram)
    31  }