From c767cf3ba0566755ffb95ee9d4f0b3939359ee66 Mon Sep 17 00:00:00 2001 From: Matt Johnstone Date: Tue, 29 Oct 2024 12:45:06 +0200 Subject: [PATCH] removed solana_active_validators metric --- cmd/solana_exporter/exporter.go | 14 -------------- cmd/solana_exporter/exporter_test.go | 4 ---- 2 files changed, 18 deletions(-) diff --git a/cmd/solana_exporter/exporter.go b/cmd/solana_exporter/exporter.go index 6803c28..cfc2e33 100644 --- a/cmd/solana_exporter/exporter.go +++ b/cmd/solana_exporter/exporter.go @@ -37,7 +37,6 @@ type SolanaCollector struct { config *ExporterConfig /// descriptors: - ValidatorActive *GaugeDesc ValidatorActiveStake *GaugeDesc ValidatorLastVote *GaugeDesc ValidatorRootSlot *GaugeDesc @@ -55,14 +54,6 @@ func NewSolanaCollector(client *rpc.Client, config *ExporterConfig) *SolanaColle rpcClient: client, 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), @@ -114,7 +105,6 @@ func NewSolanaCollector(client *rpc.Client, config *ExporterConfig) *SolanaColle } func (c *SolanaCollector) Describe(ch chan<- *prometheus.Desc) { - ch <- c.ValidatorActive.Desc ch <- c.NodeVersion.Desc ch <- c.ValidatorActiveStake.Desc ch <- c.ValidatorLastVote.Desc @@ -136,7 +126,6 @@ func (c *SolanaCollector) collectVoteAccounts(ctx context.Context, ch chan<- pro voteAccounts, err := c.rpcClient.GetVoteAccounts(ctx, rpc.CommitmentConfirmed) 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) @@ -144,9 +133,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...) diff --git a/cmd/solana_exporter/exporter_test.go b/cmd/solana_exporter/exporter_test.go index 43089f8..dad2a2f 100644 --- a/cmd/solana_exporter/exporter_test.go +++ b/cmd/solana_exporter/exporter_test.go @@ -228,10 +228,6 @@ func TestSolanaCollector(t *testing.T) { NewLV(0, "bbb", "BBB"), NewLV(0, "ccc", "CCC"), ), - collector.ValidatorActive.makeCollectionTest( - NewLV(3, "current"), - NewLV(0, "delinquent"), - ), collector.NodeVersion.makeCollectionTest( NewLV(1, "v1.0.0"), ),