go-ethereum/internal/ethapi/metrics.go
TanayK07 da83b7e392 internal/ethapi: add gas usage metric for eth_call
Add a Prometheus histogram metric (rpc/gas_used/eth_call) that tracks
the gas consumed by eth_call requests. This helps RPC providers monitor
node capacity and correlate CPU usage with actual EVM computation load.

The metric is recorded after successful execution, including reverted
calls, since they still consume gas.

Fixes #32774
2026-03-11 19:18:41 +05:30

7 lines
197 B
Go

package ethapi
import "github.com/ethereum/go-ethereum/metrics"
var (
ethCallGasUsedHist = metrics.NewRegisteredHistogram("rpc/gas_used/eth_call", nil, metrics.NewExpDecaySample(1028, 0.015))
)