@@ -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 eoaRateLimitedTransactions = prometheus .NewCounterVec (prometheus.CounterOpts {
81
+ Name : prefixedName ("eoa_rate_limited_transactions" ),
82
+ Help : "Total number of rate limited transactions by EOA" ,
83
+ }, []string {"address" })
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
+ eoaRateLimitedTransactions ,
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
+ EOARateLimited (address string )
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
+ eoaRateLimitedTransactions * prometheus.CounterVec
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
+ eoaRateLimitedTransactions : eoaRateLimitedTransactions ,
150
159
}
151
160
}
152
161
@@ -221,6 +230,12 @@ func (c *DefaultCollector) RequestRateLimited(method string) {
221
230
).Inc ()
222
231
}
223
232
233
+ func (c * DefaultCollector ) EOARateLimited (address string ) {
234
+ c .eoaRateLimitedTransactions .
235
+ With (prometheus.Labels {"address" : address }).
236
+ Inc ()
237
+ }
238
+
224
239
func prefixedName (name string ) string {
225
240
return fmt .Sprintf ("evm_gateway_%s" , name )
226
241
}
0 commit comments