github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/operations/attestations/metrics.go (about)

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