relayer/src/metrics/docs_and_dashboards/sql_metrics.md
Monitoring the health, performance, and capacity of the PostgreSQL interaction layer.
This document outlines the metrics used to track the low-level database operations within the Relayer. Unlike the Status Metrics (which track business logic flow), these metrics track the raw performance of SQL queries and database connectivity errors.
relayer_db_query_duration_seconds1ms, 5ms, 10ms, 25ms, 50ms, 100ms, 250ms, 500ms, 1s, 2.5s, 5s, 10s.table: user_decrypt_req, public_decrypt_req, input_proof_req, gateway_block_number_storerelayer_db_errors_totaltable: user_decrypt_req, public_decrypt_req, input_proof_req, gateway_block_number_storesum by (le) (rate(relayer_db_query_duration_seconds_bucket[5m]))
histogram_quantile(0.95, sum(rate(relayer_db_query_duration_seconds_bucket[5m])) by (le, table))
sum by (table) (rate(relayer_db_errors_total[5m]))