Skip to content

Commit

Permalink
Fix duplicate metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanTinianov committed Sep 4, 2024
1 parent 8e2306b commit b8d6755
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/solana/client/multinode/multi_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
var (
// PromMultiNodeRPCNodeStates reports current RPC node state
PromMultiNodeRPCNodeStates = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "multi_node_states",
Name: "solana_multi_node_states",
Help: "The number of RPC nodes currently in the given state for the given chain",
}, []string{"network", "chainId", "state"})
ErroringNodeError = fmt.Errorf("no live nodes available")
Expand Down
6 changes: 3 additions & 3 deletions pkg/solana/client/multinode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ var errInvalidChainID = errors.New("invalid chain id")

var (
promPoolRPCNodeVerifies = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_verifies",
Name: "solana_pool_rpc_node_verifies",
Help: "The total number of chain ID verifications for the given RPC node",
}, []string{"network", "chainID", "nodeName"})
promPoolRPCNodeVerifiesFailed = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_verifies_failed",
Name: "solana_pool_rpc_node_verifies_failed",
Help: "The total number of failed chain ID verifications for the given RPC node",
}, []string{"network", "chainID", "nodeName"})
promPoolRPCNodeVerifiesSuccess = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_verifies_success",
Name: "solana_pool_rpc_node_verifies_success",
Help: "The total number of successful chain ID verifications for the given RPC node",
}, []string{"network", "chainID", "nodeName"})
)
Expand Down
14 changes: 7 additions & 7 deletions pkg/solana/client/multinode/node_fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ import (

var (
promPoolRPCNodeTransitionsToAlive = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_num_transitions_to_alive",
Name: "solana_pool_rpc_node_num_transitions_to_alive",
Help: transitionString(NodeStateAlive),
}, []string{"chainID", "nodeName"})
promPoolRPCNodeTransitionsToInSync = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_num_transitions_to_in_sync",
Name: "solana_pool_rpc_node_num_transitions_to_in_sync",
Help: fmt.Sprintf("%s to %s", transitionString(NodeStateOutOfSync), NodeStateAlive),
}, []string{"chainID", "nodeName"})
promPoolRPCNodeTransitionsToOutOfSync = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_num_transitions_to_out_of_sync",
Name: "solana_pool_rpc_node_num_transitions_to_out_of_sync",
Help: transitionString(NodeStateOutOfSync),
}, []string{"chainID", "nodeName"})
promPoolRPCNodeTransitionsToUnreachable = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_num_transitions_to_unreachable",
Name: "solana_pool_rpc_node_num_transitions_to_unreachable",
Help: transitionString(NodeStateUnreachable),
}, []string{"chainID", "nodeName"})
promPoolRPCNodeTransitionsToInvalidChainID = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_num_transitions_to_invalid_chain_id",
Name: "solana_pool_rpc_node_num_transitions_to_invalid_chain_id",
Help: transitionString(NodeStateInvalidChainID),
}, []string{"chainID", "nodeName"})
promPoolRPCNodeTransitionsToUnusable = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_num_transitions_to_unusable",
Name: "solana_pool_rpc_node_num_transitions_to_unusable",
Help: transitionString(NodeStateUnusable),
}, []string{"chainID", "nodeName"})
promPoolRPCNodeTransitionsToSyncing = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_num_transitions_to_syncing",
Name: "solana_pool_rpc_node_num_transitions_to_syncing",
Help: transitionString(NodeStateSyncing),
}, []string{"chainID", "nodeName"})
)
Expand Down
12 changes: 6 additions & 6 deletions pkg/solana/client/multinode/node_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ import (

var (
promPoolRPCNodeHighestSeenBlock = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "pool_rpc_node_highest_seen_block",
Name: "solana_pool_rpc_node_highest_seen_block",
Help: "The highest seen block for the given RPC node",
}, []string{"chainID", "nodeName"})
promPoolRPCNodeHighestFinalizedBlock = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "pool_rpc_node_highest_finalized_block",
Name: "solana_pool_rpc_node_highest_finalized_block",
Help: "The highest seen finalized block for the given RPC node",
}, []string{"chainID", "nodeName"})
promPoolRPCNodeNumSeenBlocks = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_num_seen_blocks",
Name: "solana_pool_rpc_node_num_seen_blocks",
Help: "The total number of new blocks seen by the given RPC node",
}, []string{"chainID", "nodeName"})
promPoolRPCNodePolls = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_polls_total",
Name: "solana_pool_rpc_node_polls_total",
Help: "The total number of poll checks for the given RPC node",
}, []string{"chainID", "nodeName"})
promPoolRPCNodePollsFailed = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_polls_failed",
Name: "solana_pool_rpc_node_polls_failed",
Help: "The total number of failed poll checks for the given RPC node",
}, []string{"chainID", "nodeName"})
promPoolRPCNodePollsSuccess = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "pool_rpc_node_polls_success",
Name: "solana_pool_rpc_node_polls_success",
Help: "The total number of successful poll checks for the given RPC node",
}, []string{"chainID", "nodeName"})
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/solana/client/multinode/transaction_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
var (
// PromMultiNodeInvariantViolations reports violation of our assumptions
PromMultiNodeInvariantViolations = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "multi_node_invariant_violations",
Name: "solana_multi_node_invariant_violations",
Help: "The number of invariant violations",
}, []string{"network", "chainId", "invariant"})
)
Expand Down

0 comments on commit b8d6755

Please sign in to comment.