-
Notifications
You must be signed in to change notification settings - Fork 962
/
metrics.go
38 lines (35 loc) · 1.27 KB
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package attestations
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
aggregatedAttsCount = promauto.NewGauge(
prometheus.GaugeOpts{
Name: "aggregated_attestations_in_pool_total",
Help: "The number of aggregated attestations in the pool.",
},
)
unaggregatedAttsCount = promauto.NewGauge(
prometheus.GaugeOpts{
Name: "unaggregated_attestations_in_pool_total",
Help: "The number of unaggregated attestations in the pool.",
},
)
expiredAggregatedAtts = promauto.NewCounter(prometheus.CounterOpts{
Name: "expired_aggregated_atts_total",
Help: "The number of expired and deleted aggregated attestations in the pool.",
})
expiredUnaggregatedAtts = promauto.NewCounter(prometheus.CounterOpts{
Name: "expired_unaggregated_atts_total",
Help: "The number of expired and deleted unaggregated attestations in the pool.",
})
expiredBlockAtts = promauto.NewCounter(prometheus.CounterOpts{
Name: "expired_block_atts_total",
Help: "The number of expired and deleted block attestations in the pool.",
})
)
func (s *Service) updateMetrics() {
aggregatedAttsCount.Set(float64(s.cfg.Pool.AggregatedAttestationCount()))
unaggregatedAttsCount.Set(float64(s.cfg.Pool.UnaggregatedAttestationCount()))
}