(ringName string, reg prometheus.Registerer)
| 13 | } |
| 14 | |
| 15 | func 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 | } |
no test coverage detected