Skip to content

Commit 6cff9bc

Browse files
committed
Prefix metrics with multinode
1 parent 42df8bd commit 6cff9bc

File tree

5 files changed

+35
-36
lines changed

5 files changed

+35
-36
lines changed

multinode/multi_node.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ import (
1515
)
1616

1717
var (
18-
metricsRegistry = prometheus.NewRegistry()
19-
PromMultiNodeRPCNodeStates = promauto.With(metricsRegistry).NewGaugeVec(prometheus.GaugeOpts{
20-
Name: "multi_node_states",
18+
PromMultiNodeRPCNodeStates = promauto.NewGaugeVec(prometheus.GaugeOpts{
19+
Name: "multinode_states",
2120
Help: "The number of RPC nodes currently in the given state for the given chain",
2221
}, []string{"network", "chainId", "state"})
2322
ErrNodeError = fmt.Errorf("no live nodes available")

multinode/node.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ const QueryTimeout = 10 * time.Second
2020
var errInvalidChainID = errors.New("invalid chain id")
2121

2222
var (
23-
promPoolRPCNodeVerifies = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
24-
Name: "pool_rpc_node_verifies",
23+
promPoolRPCNodeVerifies = promauto.NewCounterVec(prometheus.CounterOpts{
24+
Name: "multinode_pool_rpc_node_verifies",
2525
Help: "The total number of chain ID verifications for the given RPC node",
2626
}, []string{"network", "chainID", "nodeName"})
27-
promPoolRPCNodeVerifiesFailed = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
28-
Name: "pool_rpc_node_verifies_failed",
27+
promPoolRPCNodeVerifiesFailed = promauto.NewCounterVec(prometheus.CounterOpts{
28+
Name: "multinode_pool_rpc_node_verifies_failed",
2929
Help: "The total number of failed chain ID verifications for the given RPC node",
3030
}, []string{"network", "chainID", "nodeName"})
31-
promPoolRPCNodeVerifiesSuccess = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
32-
Name: "pool_rpc_node_verifies_success",
31+
promPoolRPCNodeVerifiesSuccess = promauto.NewCounterVec(prometheus.CounterOpts{
32+
Name: "multinode_pool_rpc_node_verifies_success",
3333
Help: "The total number of successful chain ID verifications for the given RPC node",
3434
}, []string{"network", "chainID", "nodeName"})
3535
)

multinode/node_fsm.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@ import (
88
)
99

1010
var (
11-
promPoolRPCNodeTransitionsToAlive = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
12-
Name: "pool_rpc_node_num_transitions_to_alive",
11+
promPoolRPCNodeTransitionsToAlive = promauto.NewCounterVec(prometheus.CounterOpts{
12+
Name: "multinode_pool_rpc_node_num_transitions_to_alive",
1313
Help: transitionString(nodeStateAlive),
1414
}, []string{"chainID", "nodeName"})
15-
promPoolRPCNodeTransitionsToInSync = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
16-
Name: "pool_rpc_node_num_transitions_to_in_sync",
15+
promPoolRPCNodeTransitionsToInSync = promauto.NewCounterVec(prometheus.CounterOpts{
16+
Name: "multinode_pool_rpc_node_num_transitions_to_in_sync",
1717
Help: fmt.Sprintf("%s to %s", transitionString(nodeStateOutOfSync), nodeStateAlive),
1818
}, []string{"chainID", "nodeName"})
19-
promPoolRPCNodeTransitionsToOutOfSync = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
20-
Name: "pool_rpc_node_num_transitions_to_out_of_sync",
19+
promPoolRPCNodeTransitionsToOutOfSync = promauto.NewCounterVec(prometheus.CounterOpts{
20+
Name: "multinode_pool_rpc_node_num_transitions_to_out_of_sync",
2121
Help: transitionString(nodeStateOutOfSync),
2222
}, []string{"chainID", "nodeName"})
23-
promPoolRPCNodeTransitionsToUnreachable = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
24-
Name: "pool_rpc_node_num_transitions_to_unreachable",
23+
promPoolRPCNodeTransitionsToUnreachable = promauto.NewCounterVec(prometheus.CounterOpts{
24+
Name: "multinode_pool_rpc_node_num_transitions_to_unreachable",
2525
Help: transitionString(nodeStateUnreachable),
2626
}, []string{"chainID", "nodeName"})
27-
promPoolRPCNodeTransitionsToInvalidChainID = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
28-
Name: "pool_rpc_node_num_transitions_to_invalid_chain_id",
27+
promPoolRPCNodeTransitionsToInvalidChainID = promauto.NewCounterVec(prometheus.CounterOpts{
28+
Name: "multinode_pool_rpc_node_num_transitions_to_invalid_chain_id",
2929
Help: transitionString(nodeStateInvalidChainID),
3030
}, []string{"chainID", "nodeName"})
31-
promPoolRPCNodeTransitionsToUnusable = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
32-
Name: "pool_rpc_node_num_transitions_to_unusable",
31+
promPoolRPCNodeTransitionsToUnusable = promauto.NewCounterVec(prometheus.CounterOpts{
32+
Name: "multinode_pool_rpc_node_num_transitions_to_unusable",
3333
Help: transitionString(nodeStateUnusable),
3434
}, []string{"chainID", "nodeName"})
35-
promPoolRPCNodeTransitionsToSyncing = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
36-
Name: "pool_rpc_node_num_transitions_to_syncing",
35+
promPoolRPCNodeTransitionsToSyncing = promauto.NewCounterVec(prometheus.CounterOpts{
36+
Name: "multinode_pool_rpc_node_num_transitions_to_syncing",
3737
Help: transitionString(nodeStateSyncing),
3838
}, []string{"chainID", "nodeName"})
3939
)

multinode/node_lifecycle.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ import (
1616
)
1717

1818
var (
19-
promPoolRPCNodeHighestSeenBlock = promauto.With(metricsRegistry).NewGaugeVec(prometheus.GaugeOpts{
20-
Name: "pool_rpc_node_highest_seen_block",
19+
promPoolRPCNodeHighestSeenBlock = promauto.NewGaugeVec(prometheus.GaugeOpts{
20+
Name: "multinode_pool_rpc_node_highest_seen_block",
2121
Help: "The highest seen block for the given RPC node",
2222
}, []string{"chainID", "nodeName"})
23-
promPoolRPCNodeHighestFinalizedBlock = promauto.With(metricsRegistry).NewGaugeVec(prometheus.GaugeOpts{
24-
Name: "pool_rpc_node_highest_finalized_block",
23+
promPoolRPCNodeHighestFinalizedBlock = promauto.NewGaugeVec(prometheus.GaugeOpts{
24+
Name: "multinode_pool_rpc_node_highest_finalized_block",
2525
Help: "The highest seen finalized block for the given RPC node",
2626
}, []string{"chainID", "nodeName"})
27-
promPoolRPCNodeNumSeenBlocks = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
28-
Name: "pool_rpc_node_num_seen_blocks",
27+
promPoolRPCNodeNumSeenBlocks = promauto.NewCounterVec(prometheus.CounterOpts{
28+
Name: "multinode_pool_rpc_node_num_seen_blocks",
2929
Help: "The total number of new blocks seen by the given RPC node",
3030
}, []string{"chainID", "nodeName"})
31-
promPoolRPCNodePolls = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
32-
Name: "pool_rpc_node_polls_total",
31+
promPoolRPCNodePolls = promauto.NewCounterVec(prometheus.CounterOpts{
32+
Name: "multinode_pool_rpc_node_polls_total",
3333
Help: "The total number of poll checks for the given RPC node",
3434
}, []string{"chainID", "nodeName"})
35-
promPoolRPCNodePollsFailed = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
36-
Name: "pool_rpc_node_polls_failed",
35+
promPoolRPCNodePollsFailed = promauto.NewCounterVec(prometheus.CounterOpts{
36+
Name: "multinode_pool_rpc_node_polls_failed",
3737
Help: "The total number of failed poll checks for the given RPC node",
3838
}, []string{"chainID", "nodeName"})
39-
promPoolRPCNodePollsSuccess = promauto.With(metricsRegistry).NewCounterVec(prometheus.CounterOpts{
40-
Name: "pool_rpc_node_polls_success",
39+
promPoolRPCNodePollsSuccess = promauto.NewCounterVec(prometheus.CounterOpts{
40+
Name: "multinode_pool_rpc_node_polls_success",
4141
Help: "The total number of successful poll checks for the given RPC node",
4242
}, []string{"chainID", "nodeName"})
4343
)

multinode/transaction_sender.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
var (
1818
// PromMultiNodeInvariantViolations reports violation of our assumptions
1919
PromMultiNodeInvariantViolations = promauto.NewCounterVec(prometheus.CounterOpts{
20-
Name: "multi_node_invariant_violations",
20+
Name: "multinode_transaction_sender_invariant_violations",
2121
Help: "The number of invariant violations",
2222
}, []string{"network", "chainId", "invariant"})
2323
)

0 commit comments

Comments
 (0)