@@ -41,7 +41,7 @@ var evmBlockIndexedCounter = prometheus.NewCounter(prometheus.CounterOpts{
41
41
42
42
var evmTxIndexedCounter = prometheus .NewCounter (prometheus.CounterOpts {
43
43
Name : prefixedName ("txs_indexed_total" ),
44
- Help : "Total number transactions indexed" ,
44
+ Help : "Total number of transactions indexed" ,
45
45
})
46
46
47
47
var evmAccountCallCounters = prometheus .NewCounterVec (prometheus.CounterOpts {
@@ -77,6 +77,11 @@ var requestRateLimitedCounters = prometheus.NewCounterVec(prometheus.CounterOpts
77
77
Help : "Total number of rate limits by JSON-RPC method" ,
78
78
}, []string {"method" })
79
79
80
+ var transactionsDroppedCounter = prometheus .NewCounter (prometheus.CounterOpts {
81
+ Name : prefixedName ("transactions_dropped_total" ),
82
+ Help : "Total number of EVM transactions dropped due to service errors" ,
83
+ })
84
+
80
85
var metrics = []prometheus.Collector {
81
86
apiErrors ,
82
87
serverPanicsCounters ,
@@ -91,6 +96,7 @@ var metrics = []prometheus.Collector{
91
96
gasEstimationIterations ,
92
97
blockIngestionTime ,
93
98
requestRateLimitedCounters ,
99
+ transactionsDroppedCounter ,
94
100
}
95
101
96
102
type Collector interface {
@@ -106,6 +112,7 @@ type Collector interface {
106
112
GasEstimationIterations (count int )
107
113
BlockIngestionTime (blockCreation time.Time )
108
114
RequestRateLimited (method string )
115
+ TransactionsDropped (count int )
109
116
}
110
117
111
118
var _ Collector = & DefaultCollector {}
@@ -125,6 +132,7 @@ type DefaultCollector struct {
125
132
gasEstimationIterations prometheus.Gauge
126
133
blockIngestionTime prometheus.Histogram
127
134
requestRateLimitedCounters * prometheus.CounterVec
135
+ transactionsDroppedCounter prometheus.Counter
128
136
}
129
137
130
138
func NewCollector (logger zerolog.Logger ) Collector {
@@ -147,6 +155,7 @@ func NewCollector(logger zerolog.Logger) Collector {
147
155
gasEstimationIterations : gasEstimationIterations ,
148
156
blockIngestionTime : blockIngestionTime ,
149
157
requestRateLimitedCounters : requestRateLimitedCounters ,
158
+ transactionsDroppedCounter : transactionsDroppedCounter ,
150
159
}
151
160
}
152
161
@@ -221,6 +230,10 @@ func (c *DefaultCollector) RequestRateLimited(method string) {
221
230
).Inc ()
222
231
}
223
232
233
+ func (c * DefaultCollector ) TransactionsDropped (count int ) {
234
+ c .transactionsDroppedCounter .Add (float64 (count ))
235
+ }
236
+
224
237
func prefixedName (name string ) string {
225
238
return fmt .Sprintf ("evm_gateway_%s" , name )
226
239
}
0 commit comments