MCPcopy
hub / github.com/grafana/dskit / NewLifecyclerMetrics

Function NewLifecyclerMetrics

ring/lifecycler_metrics.go:14–34  ·  ring/lifecycler_metrics.go::NewLifecyclerMetrics
(ringName string, reg prometheus.Registerer)

Source from the content-addressed store, hash-verified

12}
13
14func NewLifecyclerMetrics(ringName string, reg prometheus.Registerer) *LifecyclerMetrics {
15 return &LifecyclerMetrics{
16 consulHeartbeats: promauto.With(reg).NewCounter(prometheus.CounterOpts{
17 Name: "member_consul_heartbeats_total",
18 Help: "The total number of heartbeats sent to consul.",
19 ConstLabels: prometheus.Labels{"name": ringName},
20 }),
21 shutdownDuration: promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
22 Name: "shutdown_duration_seconds",
23 Help: "Duration (in seconds) of shutdown procedure (ie transfer or flush).",
24 Buckets: prometheus.ExponentialBuckets(10, 2, 8), // Biggest bucket is 10*2^(9-1) = 2560, or 42 mins.
25 ConstLabels: prometheus.Labels{"name": ringName},
26 }, []string{"op", "status"}),
27 readonly: promauto.With(reg).NewGauge(prometheus.GaugeOpts{
28 Name: "lifecycler_read_only",
29 Help: "Set to 1 if this lifecycler's instance entry is in read-only state.",
30 ConstLabels: prometheus.Labels{"name": ringName},
31 }),
32 }
33
34}

Callers 1

NewLifecyclerFunction · 0.85

Calls 1

WithMethod · 0.80

Tested by

no test coverage detected