@@ -66,12 +66,20 @@ var gasEstimationIterations = prometheus.NewGauge(prometheus.GaugeOpts{
6666 Help : "Number of iterations taken to estimate the gas of a EVM call/tx" ,
6767})
6868
69+ // Time difference between block proposal time and block indexing time
6970var blockIngestionTime = prometheus .NewHistogram (prometheus.HistogramOpts {
7071 Name : prefixedName ("block_ingestion_time_seconds" ),
71- Help : "Time taken to fully ingest an EVM block in the local state index " ,
72+ Help : "Latency from EVM block proposal time to indexing completion (wall-clock duration) " ,
7273 Buckets : []float64 {.5 , 1 , 2.5 , 5 , 10 , 15 , 20 , 30 , 45 },
7374})
7475
76+ // EVM block processing time during event ingestion, including transaction replay
77+ // and state validation
78+ var blockProcessTime = prometheus .NewSummary (prometheus.SummaryOpts {
79+ Name : prefixedName ("block_process_time_seconds" ),
80+ Help : "Processing time to fully index an EVM block in the local state index" ,
81+ })
82+
7583var requestRateLimitedCounters = prometheus .NewCounterVec (prometheus.CounterOpts {
7684 Name : prefixedName ("request_rate_limited" ),
7785 Help : "Total number of rate limits by JSON-RPC method" ,
@@ -105,6 +113,7 @@ var metrics = []prometheus.Collector{
105113 availableSigningKeys ,
106114 gasEstimationIterations ,
107115 blockIngestionTime ,
116+ blockProcessTime ,
108117 requestRateLimitedCounters ,
109118 transactionsDroppedCounter ,
110119 rateLimitedTransactionsCounter ,
@@ -123,6 +132,7 @@ type Collector interface {
123132 AvailableSigningKeys (count int )
124133 GasEstimationIterations (count int )
125134 BlockIngestionTime (blockCreation time.Time )
135+ BlockProcessTime (start time.Time )
126136 RequestRateLimited (method string )
127137 TransactionsDropped (count int )
128138 TransactionRateLimited ()
@@ -147,6 +157,7 @@ type DefaultCollector struct {
147157 availableSigningkeys prometheus.Gauge
148158 gasEstimationIterations prometheus.Gauge
149159 blockIngestionTime prometheus.Histogram
160+ blockProcessTime prometheus.Summary
150161 requestRateLimitedCounters * prometheus.CounterVec
151162 transactionsDroppedCounter prometheus.Counter
152163 rateLimitedTransactionsCounter prometheus.Counter
@@ -173,6 +184,7 @@ func NewCollector(logger zerolog.Logger) Collector {
173184 availableSigningkeys : availableSigningKeys ,
174185 gasEstimationIterations : gasEstimationIterations ,
175186 blockIngestionTime : blockIngestionTime ,
187+ blockProcessTime : blockProcessTime ,
176188 requestRateLimitedCounters : requestRateLimitedCounters ,
177189 transactionsDroppedCounter : transactionsDroppedCounter ,
178190 rateLimitedTransactionsCounter : rateLimitedTransactionsCounter ,
@@ -243,6 +255,10 @@ func (c *DefaultCollector) BlockIngestionTime(blockCreation time.Time) {
243255 Observe (time .Since (blockCreation ).Seconds ())
244256}
245257
258+ func (c * DefaultCollector ) BlockProcessTime (start time.Time ) {
259+ c .blockProcessTime .Observe (time .Since (start ).Seconds ())
260+ }
261+
246262func (c * DefaultCollector ) RequestRateLimited (method string ) {
247263 c .requestRateLimitedCounters .With (
248264 prometheus.Labels {
0 commit comments