@@ -82,6 +82,11 @@ var transactionsDroppedCounter = prometheus.NewCounter(prometheus.CounterOpts{
82
82
Help : "Total number of EVM transactions dropped due to service errors" ,
83
83
})
84
84
85
+ var eoaRateLimitedTransactions = prometheus .NewCounterVec (prometheus.CounterOpts {
86
+ Name : prefixedName ("eoa_rate_limited_transactions" ),
87
+ Help : "Total number of rate limited transactions by EOA" ,
88
+ }, []string {"address" })
89
+
85
90
var metrics = []prometheus.Collector {
86
91
apiErrors ,
87
92
serverPanicsCounters ,
@@ -97,6 +102,7 @@ var metrics = []prometheus.Collector{
97
102
blockIngestionTime ,
98
103
requestRateLimitedCounters ,
99
104
transactionsDroppedCounter ,
105
+ eoaRateLimitedTransactions ,
100
106
}
101
107
102
108
type Collector interface {
@@ -113,6 +119,7 @@ type Collector interface {
113
119
BlockIngestionTime (blockCreation time.Time )
114
120
RequestRateLimited (method string )
115
121
TransactionsDropped (count int )
122
+ EOARateLimited (address string )
116
123
}
117
124
118
125
var _ Collector = & DefaultCollector {}
@@ -133,6 +140,7 @@ type DefaultCollector struct {
133
140
blockIngestionTime prometheus.Histogram
134
141
requestRateLimitedCounters * prometheus.CounterVec
135
142
transactionsDroppedCounter prometheus.Counter
143
+ eoaRateLimitedTransactions * prometheus.CounterVec
136
144
}
137
145
138
146
func NewCollector (logger zerolog.Logger ) Collector {
@@ -156,6 +164,7 @@ func NewCollector(logger zerolog.Logger) Collector {
156
164
blockIngestionTime : blockIngestionTime ,
157
165
requestRateLimitedCounters : requestRateLimitedCounters ,
158
166
transactionsDroppedCounter : transactionsDroppedCounter ,
167
+ eoaRateLimitedTransactions : eoaRateLimitedTransactions ,
159
168
}
160
169
}
161
170
@@ -234,6 +243,12 @@ func (c *DefaultCollector) TransactionsDropped(count int) {
234
243
c .transactionsDroppedCounter .Add (float64 (count ))
235
244
}
236
245
246
+ func (c * DefaultCollector ) EOARateLimited (address string ) {
247
+ c .eoaRateLimitedTransactions .
248
+ With (prometheus.Labels {"address" : address }).
249
+ Inc ()
250
+ }
251
+
237
252
func prefixedName (name string ) string {
238
253
return fmt .Sprintf ("evm_gateway_%s" , name )
239
254
}
0 commit comments