Problem
RPC metrics in crates/rpc/src/metrics.rs use expect() during lazy static initialization, which will panic if metric registration fails.
Details
static ref RPC_REQUESTS_TOTAL: IntCounterVec = IntCounterVec::new(...)
.expect("Failed to register rpc_requests_total metric")
All metric registrations follow this pattern:
RPC_REQUESTS_TOTAL
RPC_REQUEST_DURATION
RPC_ACTIVE_CONNECTIONS
RPC_WS_SUBSCRIPTIONS
RPC_RATE_LIMIT_REJECTIONS
Impact
- If Prometheus registry has naming conflicts or is exhausted, node crashes at startup
- No graceful degradation to running without metrics
Problem
RPC metrics in
crates/rpc/src/metrics.rsuseexpect()during lazy static initialization, which will panic if metric registration fails.Details
All metric registrations follow this pattern:
RPC_REQUESTS_TOTALRPC_REQUEST_DURATIONRPC_ACTIVE_CONNECTIONSRPC_WS_SUBSCRIPTIONSRPC_RATE_LIMIT_REJECTIONSImpact