Skip to content

Commit

Permalink
removed solana_active_validators metric
Browse files Browse the repository at this point in the history
  • Loading branch information
johnstonematt committed Oct 29, 2024
1 parent fdf2fb6 commit c767cf3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
14 changes: 0 additions & 14 deletions cmd/solana_exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type SolanaCollector struct {
config *ExporterConfig

/// descriptors:
ValidatorActive *GaugeDesc
ValidatorActiveStake *GaugeDesc
ValidatorLastVote *GaugeDesc
ValidatorRootSlot *GaugeDesc
Expand All @@ -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),
Expand Down Expand Up @@ -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
Expand All @@ -136,17 +126,13 @@ 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)
ch <- c.ValidatorDelinquent.NewInvalidMetric(err)
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...)
Expand Down
4 changes: 0 additions & 4 deletions cmd/solana_exporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
Expand Down

0 comments on commit c767cf3

Please sign in to comment.