@@ -34,6 +34,8 @@ type Metrics struct {
3434 BlockReceiveDelay * prometheus.HistogramVec
3535 // JsonRpcRequestDuration tracks the duration of JSON-RPC requests to the EVM node.
3636 JsonRpcRequestDuration * prometheus.HistogramVec
37+ // JsonRpcRequestDurationSummary tracks JSON-RPC request duration with percentiles over a rolling window.
38+ JsonRpcRequestDurationSummary * prometheus.SummaryVec
3739 // JsonRpcRequestSloSeconds exports constant SLO thresholds for JSON-RPC requests.
3840 JsonRpcRequestSloSeconds * prometheus.GaugeVec
3941 // BlockTimeSloSeconds exports constant SLO thresholds for block time.
@@ -169,6 +171,22 @@ func NewWithRegistry(namespace string, registerer prometheus.Registerer) *Metric
169171 },
170172 []string {"chain_id" },
171173 ),
174+ JsonRpcRequestDurationSummary : factory .NewSummaryVec (
175+ prometheus.SummaryOpts {
176+ Namespace : namespace ,
177+ Name : "jsonrpc_request_duration_summary_seconds" ,
178+ Help : "JSON-RPC request duration with percentiles over a rolling window" ,
179+ Objectives : map [float64 ]float64 {
180+ 0.5 : 0.05 ,
181+ 0.9 : 0.01 ,
182+ 0.95 : 0.01 ,
183+ 0.99 : 0.001 ,
184+ },
185+ MaxAge : 60 * time .Second ,
186+ AgeBuckets : 6 ,
187+ },
188+ []string {"chain_id" },
189+ ),
172190 JsonRpcRequestSloSeconds : factory .NewGaugeVec (
173191 prometheus.GaugeOpts {
174192 Namespace : namespace ,
@@ -472,6 +490,7 @@ func (m *Metrics) RecordBlockReceiveDelay(chainID string, delay time.Duration) {
472490// RecordJsonRpcRequestDuration records the duration of a JSON-RPC request
473491func (m * Metrics ) RecordJsonRpcRequestDuration (chainID string , duration time.Duration ) {
474492 m .JsonRpcRequestDuration .WithLabelValues (chainID ).Observe (duration .Seconds ())
493+ m .JsonRpcRequestDurationSummary .WithLabelValues (chainID ).Observe (duration .Seconds ())
475494}
476495
477496// InitializeJsonRpcSloThresholds initializes the constant SLO threshold gauges for JSON-RPC requests
0 commit comments