Plaidly Docs

RPC Provider Health Metrics

Metrics, alerts, and dashboard grouping for chain/provider reliability

RPC Provider Health Metrics

Use this page for BDT-321 on the M6 Observability + Settlement Ops milestone.

Plaidly depends on chain RPC providers for payment detection, confirmation tracking, sweeps, and future agent spend flows. Health signals must distinguish a provider outage from chain congestion so operators can fail over, pause risky flows, or explain delayed settlement.

Required Metrics

MetricTypeLabelsPurpose
plaidly_rpc_call_totalCounterprovider, chain, network, method, statusRequest volume and error rate per provider and method.
plaidly_rpc_call_duration_secondsHistogramprovider, chain, network, methodProvider latency and tail behavior.
plaidly_rpc_breaker_stateGaugeprovider, chain, networkCircuit breaker state: 0=closed, 1=half_open, 2=open.
plaidly_chain_confirmation_lag_blocksGaugechain, network, tokenDistance between observed head and required confirmation depth.
plaidly_chain_confirmation_lag_secondsGaugechain, network, tokenWall-clock lag for pending confirmations.
plaidly_payment_detection_lag_secondsHistogramchain, network, tokenTime from payer transfer to Plaidly detection.
plaidly_queue_lag_secondsGaugequeue, chain, networkEvent or worker queue delay for balance checks, sweeps, webhooks, and finalization.
plaidly_provider_failover_totalCounterfrom_provider, to_provider, chain, network, reasonTracks automatic provider failover events.

Alert Rules

AlertSeverityConditionInterpretation
Provider hard outageP1rpc_error_rate > 50% for one provider and one chain/network for 5 minutesProvider-specific outage. Fail over if another provider is healthy.
Chain-wide RPC outageP1rpc_error_rate > 50% across all providers for one chain/network for 5 minutesChain endpoint or network-wide issue. Do not blame a single provider.
High RPC latencyP2p95 duration above 5 seconds for 10 minutesPayments may detect slowly; review provider and queue lag together.
Circuit breaker openP2, P1 if all providers openAny plaidly_rpc_breaker_state == 2 for 5 minutesProvider is removed from active routing.
Confirmation lag highP2confirmation_lag_seconds > 900 for 15 minutesChain congestion or indexer lag.
Payment detection lag highP2p95 detection lag above 10 minutes for 15 minutesBalance checker/indexer is delayed.
Queue lag highP2queue lag above 5 minutes for balance or finalization workersInternal processing is delayed even if chains are healthy.

Triage

  1. Compare provider error rate by provider, chain, and network.

    • One provider bad and others healthy: fail over or lower its priority.
    • All providers bad for one chain: treat as chain/network incident.
    • All chains bad for one provider: treat as provider account/API incident.
  2. Compare rpc_call_duration_seconds, confirmation_lag_seconds, and queue_lag_seconds.

    • RPC slow but confirmation lag normal: provider issue.
    • Confirmation lag high across providers: chain congestion.
    • Queue lag high but RPC/chain normal: internal worker capacity issue.
  3. Check affected payment sessions.

    • Pending sessions need detection-lag status.
    • Paid/finalizing sessions need finalization and webhook queue status.
    • Merchant-facing diagnostics should say whether the recommended action is wait, retry webhook, or contact support.
  4. Keep payloads safe.

    • Include provider, chain, network, method, status, queue names, request IDs, and session IDs.
    • Do not include RPC credentials, webhook secrets, private keys, raw signed payloads, or API keys.

Dashboard Grouping

Group health by:

  • chain/network
  • provider priority order
  • current breaker state
  • p50/p95/p99 RPC latency
  • error rate
  • confirmation lag
  • queue lag
  • active incident link

Use the chain/network group as the primary dashboard row. Provider details belong inside the row so operators can tell provider outage from chain congestion without opening logs.

On this page