mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-18 07:48:46 +00:00
122 lines
3.1 KiB
Go
122 lines
3.1 KiB
Go
|
package metrics
|
||
|
|
||
|
import (
|
||
|
"github.com/prometheus/client_golang/prometheus"
|
||
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
// ValidatorStatusesGaugeVec used to track validator statuses by public key.
|
||
|
ValidatorStatusesGaugeVec = promauto.NewGaugeVec(
|
||
|
prometheus.GaugeOpts{
|
||
|
Namespace: "validator",
|
||
|
Name: "statuses",
|
||
|
Help: "validator statuses: 0 UNKNOWN, 1 DEPOSITED, 2 PENDING, 3 ACTIVE, 4 EXITING, 5 SLASHING, 6 EXITED",
|
||
|
},
|
||
|
[]string{
|
||
|
// Validator pubkey.
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
// ValidatorAggSuccessVec used to count successful aggregations.
|
||
|
ValidatorAggSuccessVec = promauto.NewCounterVec(
|
||
|
prometheus.CounterOpts{
|
||
|
Namespace: "validator",
|
||
|
Name: "successful_aggregations",
|
||
|
},
|
||
|
[]string{
|
||
|
// validator pubkey
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
// ValidatorAggFailVec used to count failed aggregations.
|
||
|
ValidatorAggFailVec = promauto.NewCounterVec(
|
||
|
prometheus.CounterOpts{
|
||
|
Namespace: "validator",
|
||
|
Name: "failed_aggregations",
|
||
|
},
|
||
|
[]string{
|
||
|
// validator pubkey
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
// ValidatorProposeSuccessVec used to count successful proposals.
|
||
|
ValidatorProposeSuccessVec = promauto.NewCounterVec(
|
||
|
prometheus.CounterOpts{
|
||
|
Namespace: "validator",
|
||
|
Name: "successful_proposals",
|
||
|
},
|
||
|
[]string{
|
||
|
// validator pubkey
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
// ValidatorProposeFailVec used to count failed proposals.
|
||
|
ValidatorProposeFailVec = promauto.NewCounterVec(
|
||
|
prometheus.CounterOpts{
|
||
|
Namespace: "validator",
|
||
|
Name: "failed_proposals",
|
||
|
},
|
||
|
[]string{
|
||
|
// validator pubkey
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
// ValidatorProposeFailVecSlasher used to count failed proposals by slashing protection.
|
||
|
ValidatorProposeFailVecSlasher = promauto.NewCounterVec(
|
||
|
prometheus.CounterOpts{
|
||
|
Name: "validator_proposals_rejected_total",
|
||
|
Help: "Count the block proposals rejected by slashing protection.",
|
||
|
},
|
||
|
[]string{
|
||
|
// validator pubkey
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
// ValidatorBalancesGaugeVec used to keep track of validator balances by public key.
|
||
|
ValidatorBalancesGaugeVec = promauto.NewGaugeVec(
|
||
|
prometheus.GaugeOpts{
|
||
|
Namespace: "validator",
|
||
|
Name: "balance",
|
||
|
Help: "current validator balance.",
|
||
|
},
|
||
|
[]string{
|
||
|
// validator pubkey
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
// ValidatorAttestSuccessVec used to count successful attestations.
|
||
|
ValidatorAttestSuccessVec = promauto.NewCounterVec(
|
||
|
prometheus.CounterOpts{
|
||
|
Namespace: "validator",
|
||
|
Name: "successful_attestations",
|
||
|
},
|
||
|
[]string{
|
||
|
// validator pubkey
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
// ValidatorAttestFailVec used to count failed attestations.
|
||
|
ValidatorAttestFailVec = promauto.NewCounterVec(
|
||
|
prometheus.CounterOpts{
|
||
|
Namespace: "validator",
|
||
|
Name: "failed_attestations",
|
||
|
},
|
||
|
[]string{
|
||
|
// validator pubkey
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
// ValidatorAttestFailVecSlasher used to count failed attestations by slashing protection.
|
||
|
ValidatorAttestFailVecSlasher = promauto.NewCounterVec(
|
||
|
prometheus.CounterOpts{
|
||
|
Name: "validator_attestations_rejected_total",
|
||
|
Help: "Count the attestations rejected by slashing protection.",
|
||
|
},
|
||
|
[]string{
|
||
|
// validator pubkey
|
||
|
"pubkey",
|
||
|
},
|
||
|
)
|
||
|
)
|