eth_call metrics

This commit is contained in:
pragmaxim
2026-02-13 08:36:19 +01:00
parent f37e1e6706
commit 5880cd2129
4 changed files with 69 additions and 0 deletions

View File

@@ -20,6 +20,9 @@ type Metrics struct {
MempoolResyncDuration prometheus.Histogram
TxCacheEfficiency *prometheus.CounterVec
RPCLatency *prometheus.HistogramVec
EthCallRequests *prometheus.CounterVec
EthCallErrors *prometheus.CounterVec
EthCallBatchSize prometheus.Histogram
IndexResyncErrors *prometheus.CounterVec
IndexDBSize prometheus.Gauge
ExplorerViews *prometheus.CounterVec
@@ -149,6 +152,30 @@ func GetMetrics(coin string) (*Metrics, error) {
},
[]string{"method", "error"},
)
metrics.EthCallRequests = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "blockbook_eth_call_requests",
Help: "Total number of eth_call requests by mode",
ConstLabels: Labels{"coin": coin},
},
[]string{"mode"},
)
metrics.EthCallErrors = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "blockbook_eth_call_errors",
Help: "Total number of eth_call errors by mode and type",
ConstLabels: Labels{"coin": coin},
},
[]string{"mode", "type"},
)
metrics.EthCallBatchSize = prometheus.NewHistogram(
prometheus.HistogramOpts{
Name: "blockbook_eth_call_batch_size",
Help: "Number of eth_call items per batch request",
Buckets: []float64{1, 2, 5, 10, 20, 50, 100, 200},
ConstLabels: Labels{"coin": coin},
},
)
metrics.IndexResyncErrors = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "blockbook_index_resync_errors",