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

Function NewBasicLifecyclerMetrics

ring/basic_lifecycler_metrics.go:15–38  ·  view source on GitHub ↗
(ringName string, reg prometheus.Registerer)

Source from the content-addressed store, hash-verified

13}
14
15func NewBasicLifecyclerMetrics(ringName string, reg prometheus.Registerer) *BasicLifecyclerMetrics {
16 return &BasicLifecyclerMetrics{
17 heartbeats: promauto.With(reg).NewCounter(prometheus.CounterOpts{
18 Name: "ring_member_heartbeats_total",
19 Help: "The total number of heartbeats sent.",
20 ConstLabels: prometheus.Labels{"name": ringName},
21 }),
22 tokensOwned: promauto.With(reg).NewGauge(prometheus.GaugeOpts{
23 Name: "ring_member_tokens_owned",
24 Help: "The number of tokens owned in the ring.",
25 ConstLabels: prometheus.Labels{"name": ringName},
26 }),
27 tokensToOwn: promauto.With(reg).NewGauge(prometheus.GaugeOpts{
28 Name: "ring_member_tokens_to_own",
29 Help: "The number of tokens to own in the ring.",
30 ConstLabels: prometheus.Labels{"name": ringName},
31 }),
32 readOnly: promauto.With(reg).NewGauge(prometheus.GaugeOpts{
33 Name: "lifecycler_read_only",
34 Help: "Set to 1 if this lifecycler's instance entry is in read-only state.",
35 ConstLabels: prometheus.Labels{"name": ringName},
36 }),
37 }
38}

Callers 1

NewBasicLifecyclerFunction · 0.85

Calls 1

WithMethod · 0.80

Tested by

no test coverage detected