Documentation
¶
Index ¶
Constants ¶
View Source
const ( EVM = "EVM" Solana = "solana" )
Variables ¶
View Source
var ( PromLpQueryDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "log_poller_query_duration", Help: "Measures duration of Log Poller's queries fetching logs", Buckets: sqlLatencyBuckets, }, []string{"chainFamily", "chainID", "query", "type"}) PromLpQueryDataSets = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "log_poller_query_dataset_size", Help: "Measures size of the datasets returned by Log Poller's queries", }, []string{"chainFamily", "chainID", "query", "type"}) PromLpLogsInserted = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "log_poller_logs_inserted", Help: "Counter to track number of logs inserted by Log Poller", }, []string{"chainFamily", "chainID"}) PromLpBlocksInserted = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "log_poller_blocks_inserted", Help: "Counter to track number of blocks inserted by Log Poller", }, []string{"chainFamily", "chainID"}) PromLpDiscoveryLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "logpoller_log_discovery_latency", Help: "Measures duration between block insertion time and block timestamp", }, []string{"chainFamily", "chainID"}) )
View Source
var ( NodeBalance = promauto.NewGaugeVec( prometheus.GaugeOpts{Name: "node_balance", Help: "Account balances"}, []string{"account", "chainID", "chainFamily"}, ) )
View Source
var ( PromPoolRPCNodeHighestFinalizedBlock = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "pool_rpc_node_highest_finalized_block", Help: "The highest seen finalized block for the given RPC node", }, []string{"network", "chainID", "nodeName"}) )
View Source
var ( RPCCallLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: rpcCallLatencyBeholder, Help: "The duration of an RPC call in nanoseconds", Buckets: []float64{ float64(50 * time.Millisecond), float64(100 * time.Millisecond), float64(200 * time.Millisecond), float64(500 * time.Millisecond), float64(1 * time.Second), float64(2 * time.Second), float64(4 * time.Second), float64(8 * time.Second), }, }, []string{"chainFamily", "chainID", "rpcUrl", "isSendOnly", "success", "rpcCallName"}) )
Functions ¶
This section is empty.
Types ¶
type GenericBalanceMetrics ¶
type GenericBalanceMetrics interface {
RecordNodeBalance(ctx context.Context, account string, balance float64)
}
func NewGenericBalanceMetrics ¶
func NewGenericBalanceMetrics(network string, chainID string) (GenericBalanceMetrics, error)
type GenericLogPollerMetrics ¶
type GenericLogPollerMetrics interface {
RecordQueryDuration(ctx context.Context, queryName string, queryType QueryType, duration float64)
RecordQueryDatasetSize(ctx context.Context, queryName string, queryType QueryType, size int64)
IncrementLogsInserted(ctx context.Context, numLogs int64)
IncrementBlocksInserted(ctx context.Context, numBlocks int64)
RecordLogDiscoveryLatency(ctx context.Context, latency float64)
}
func NewGenericLogPollerMetrics ¶
func NewGenericLogPollerMetrics(chainID string, chainFamily string) (GenericLogPollerMetrics, error)
type GenericMultiNodeMetrics ¶
type GenericMultiNodeMetrics interface {
RecordNodeStates(ctx context.Context, state string, count int64)
RecordNodeClientVersion(ctx context.Context, nodeName string, version string)
IncrementNodeVerifies(ctx context.Context, nodeName string)
IncrementNodeVerifiesFailed(ctx context.Context, nodeName string)
IncrementNodeVerifiesSuccess(ctx context.Context, nodeName string)
IncrementNodeTransitionsToAlive(ctx context.Context, nodeName string)
IncrementNodeTransitionsToInSync(ctx context.Context, nodeName string)
IncrementNodeTransitionsToOutOfSync(ctx context.Context, nodeName string)
IncrementNodeTransitionsToUnreachable(ctx context.Context, nodeName string)
IncrementNodeTransitionsToInvalidChainID(ctx context.Context, nodeName string)
IncrementNodeTransitionsToUnusable(ctx context.Context, nodeName string)
IncrementNodeTransitionsToSyncing(ctx context.Context, nodeName string)
IncrementInvariantViolations(ctx context.Context, invariant string)
SetHighestSeenBlock(ctx context.Context, nodeName string, blockNumber int64)
SetHighestFinalizedBlock(ctx context.Context, nodeName string, blockNumber int64)
IncrementSeenBlocks(ctx context.Context, nodeName string)
IncrementPolls(ctx context.Context, nodeName string)
IncrementPollsFailed(ctx context.Context, nodeName string)
IncrementPollsSuccess(ctx context.Context, nodeName string)
IncrementFinalizedStateFailed(ctx context.Context, nodeName string)
IncrementNodeTransitionsToFinalizedStateNotAvailable(ctx context.Context, nodeName string)
}
func NewGenericMultiNodeMetrics ¶
func NewGenericMultiNodeMetrics(network string, chainID string) (GenericMultiNodeMetrics, error)
type GenericTXMMetrics ¶
type GenericTXMMetrics interface {
IncrementNumBroadcastedTxs(ctx context.Context)
RecordTimeUntilTxBroadcast(ctx context.Context, duration float64)
IncrementNumGasBumps(ctx context.Context)
IncrementGasBumpExceedsLimit(ctx context.Context)
IncrementNumConfirmedTxs(ctx context.Context, confirmedTransactions int)
RecordTimeUntilTxConfirmed(ctx context.Context, duration float64)
RecordBlocksUntilTxConfirmed(ctx context.Context, blocksElapsed float64)
}
func NewGenericTxmMetrics ¶
func NewGenericTxmMetrics(chainID string) (GenericTXMMetrics, error)
type NoopRPCClientMetrics ¶
type NoopRPCClientMetrics struct{}
NoopRPCClientMetrics is a no-op implementation for when metrics are disabled.
type RPCClientMetrics ¶
type RPCClientMetrics interface {
// RecordRequest records latency for an RPC call (observed in nanoseconds for Prometheus and Beholder).
// Failures use success="false"; derive error rate from rpc_call_latency_count{success="false"} (or equivalent).
RecordRequest(ctx context.Context, rpcURL string, isSendOnly bool, callName string, latency time.Duration, err error)
}
RPCClientMetrics records RPC call latency to Prometheus and Beholder (failures: success="false"; same pattern as multinode metrics). Construct once per chain (or process) with ChainFamily and ChainID; pass rpcUrl and isSendOnly on each call when they vary by node or request.
func NewRPCClientMetrics ¶
func NewRPCClientMetrics(cfg RPCClientMetricsConfig) (RPCClientMetrics, error)
NewRPCClientMetrics creates RPC client metrics that publish to Prometheus and Beholder.
type RPCClientMetricsConfig ¶
RPCClientMetricsConfig holds labels that are fixed for the lifetime of the metrics handle (e.g. one per chain).
Click to show internal directories.
Click to hide internal directories.