Description
Currently only the Relayer has Prometheus instrumentation. The API Server and Indexer expose /health but have no /metrics endpoint and no application-level metrics.
Suggested metrics for API Server:
- api_requests_total (counter, labels:
method, endpoint, status)
- api_request_duration_seconds (histogram, labels:
method, endpoint)
- api_active_connections (gauge)
- api_canton_rpc_duration_seconds (histogram — time spent calling Canton ledger)
- api_eth_rpc_requests_total (counter, labels:
method, status)
Suggested metrics for Indexer:
- indexer_events_processed_total (counter, labels: event_type)
- indexer_sync_lag_seconds (gauge — how far behind the ledger)
- indexer_last_offset (gauge — last processed ledger offset)
- indexer_db_query_duration_seconds (histogram, labels: query)
Scope:
- Add Monitoring config section to API Server and Indexer configs
- Register promhttp.Handler() on each service
- Add middleware for HTTP request metrics (chi middleware or custom)
- Update Prometheus scrape config to include all three services
- Add metrics definitions in dedicated files or extend
metrics
Acceptance Criteria:
Description
Currently only the Relayer has Prometheus instrumentation. The API Server and Indexer expose /health but have no /metrics endpoint and no application-level metrics.
Suggested metrics for API Server:
method,endpoint,status)method,endpoint)method,status)Suggested metrics for Indexer:
Scope:
metricsAcceptance Criteria: