removed solana_active_validators metric
This commit is contained in:
parent
cbdf5065a6
commit
c9f2bd5ab0
|
@ -14,7 +14,6 @@ import (
|
|||
|
||||
const (
|
||||
SkipStatusLabel = "status"
|
||||
StateLabel = "state"
|
||||
NodekeyLabel = "nodekey"
|
||||
VotekeyLabel = "votekey"
|
||||
VersionLabel = "version"
|
||||
|
@ -39,7 +38,6 @@ type SolanaCollector struct {
|
|||
config *ExporterConfig
|
||||
|
||||
/// descriptors:
|
||||
ValidatorActive *GaugeDesc
|
||||
ValidatorActiveStake *GaugeDesc
|
||||
ValidatorLastVote *GaugeDesc
|
||||
ValidatorRootSlot *GaugeDesc
|
||||
|
@ -61,14 +59,6 @@ func NewSolanaCollector(provider rpc.Provider, config *ExporterConfig) *SolanaCo
|
|||
rpcClient: provider,
|
||||
logger: slog.Get(),
|
||||
config: config,
|
||||
ValidatorActive: NewGaugeDesc(
|
||||
"solana_validator_active",
|
||||
fmt.Sprintf(
|
||||
"Total number of active validators, grouped by %s ('%s' or '%s')",
|
||||
StateLabel, StateCurrent, StateDelinquent,
|
||||
),
|
||||
StateLabel,
|
||||
),
|
||||
ValidatorActiveStake: NewGaugeDesc(
|
||||
"solana_validator_active_stake",
|
||||
fmt.Sprintf("Active stake per validator (represented by %s and %s)", VotekeyLabel, NodekeyLabel),
|
||||
|
@ -120,7 +110,6 @@ func NewSolanaCollector(provider rpc.Provider, config *ExporterConfig) *SolanaCo
|
|||
}
|
||||
|
||||
func (c *SolanaCollector) Describe(ch chan<- *prometheus.Desc) {
|
||||
ch <- c.ValidatorActive.Desc
|
||||
ch <- c.NodeVersion.Desc
|
||||
ch <- c.ValidatorActiveStake.Desc
|
||||
ch <- c.ValidatorLastVote.Desc
|
||||
|
@ -142,7 +131,6 @@ func (c *SolanaCollector) collectVoteAccounts(ctx context.Context, ch chan<- pro
|
|||
voteAccounts, err := c.rpcClient.GetVoteAccounts(ctx, rpc.CommitmentConfirmed, nil)
|
||||
if err != nil {
|
||||
c.logger.Errorf("failed to get vote accounts: %v", err)
|
||||
ch <- c.ValidatorActive.NewInvalidMetric(err)
|
||||
ch <- c.ValidatorActiveStake.NewInvalidMetric(err)
|
||||
ch <- c.ValidatorLastVote.NewInvalidMetric(err)
|
||||
ch <- c.ValidatorRootSlot.NewInvalidMetric(err)
|
||||
|
@ -150,9 +138,6 @@ func (c *SolanaCollector) collectVoteAccounts(ctx context.Context, ch chan<- pro
|
|||
return
|
||||
}
|
||||
|
||||
ch <- c.ValidatorActive.MustNewConstMetric(float64(len(voteAccounts.Delinquent)), StateDelinquent)
|
||||
ch <- c.ValidatorActive.MustNewConstMetric(float64(len(voteAccounts.Current)), StateCurrent)
|
||||
|
||||
for _, account := range append(voteAccounts.Current, voteAccounts.Delinquent...) {
|
||||
accounts := []string{account.VotePubkey, account.NodePubkey}
|
||||
ch <- c.ValidatorActiveStake.MustNewConstMetric(float64(account.ActivatedStake), accounts...)
|
||||
|
|
|
@ -468,7 +468,6 @@ func TestSolanaCollector_Collect_Static(t *testing.T) {
|
|||
prometheus.NewPedanticRegistry().MustRegister(collector)
|
||||
|
||||
testCases := []collectionTest{
|
||||
collector.ValidatorActive.makeCollectionTest(NewLV(2, "current"), NewLV(1, "delinquent")),
|
||||
collector.ValidatorActiveStake.makeCollectionTest(abcValues(49, 42, 43)...),
|
||||
collector.ValidatorLastVote.makeCollectionTest(abcValues(92, 147, 148)...),
|
||||
collector.ValidatorRootSlot.makeCollectionTest(abcValues(3, 18, 19)...),
|
||||
|
@ -489,7 +488,6 @@ func TestSolanaCollector_Collect_Dynamic(t *testing.T) {
|
|||
|
||||
// start off by testing initial state:
|
||||
testCases := []collectionTest{
|
||||
collector.ValidatorActive.makeCollectionTest(NewLV(3, "current"), NewLV(0, "delinquent")),
|
||||
collector.ValidatorActiveStake.makeCollectionTest(abcValues(1_000_000, 1_000_000, 1_000_000)...),
|
||||
collector.ValidatorRootSlot.makeCollectionTest(abcValues(0, 0, 0)...),
|
||||
collector.ValidatorDelinquent.makeCollectionTest(abcValues(0, 0, 0)...),
|
||||
|
@ -509,7 +507,6 @@ func TestSolanaCollector_Collect_Dynamic(t *testing.T) {
|
|||
|
||||
// now test the final state
|
||||
testCases = []collectionTest{
|
||||
collector.ValidatorActive.makeCollectionTest(NewLV(2, "current"), NewLV(1, "delinquent")),
|
||||
collector.ValidatorActiveStake.makeCollectionTest(abcValues(2_000_000, 500_000, 1_000_000)...),
|
||||
collector.ValidatorRootSlot.makeCollectionTest(abcValues(0, 0, 0)...),
|
||||
collector.ValidatorDelinquent.makeCollectionTest(abcValues(0, 0, 1)...),
|
||||
|
|
Loading…
Reference in New Issue