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