Readyset Docs

Metrics

Every Prometheus metric exported by the QueryPilot Router, its plugins, and the Analytics.

Overview

The Router (binary querypilot) serves Prometheus metrics at its [metrics] bind, default 127.0.0.1:9090, when [metrics] enabled = true. Analytics (binary querypilot-analytics) serves its own metrics at its own [metrics] bind, also defaulting to 127.0.0.1:9090; give the two distinct ports when they share a host. All series names keep the sqp_ prefix.

The Router endpoint exports the core sqp_* series plus the plugin-chain, Guard (sqp_guard_*), and Accelerator (sqp_qp_*) series for whichever plugins are enabled. The Analytics endpoint exports the sqp_duckdb_* and sqp_snapshot_* series.

Series appear on first emission, so a metric is absent until the code path that records it has run at least once. See Operations for alerting guidance.

The protocol label takes the values postgres and mysql. MySQL support is in preview; PostgreSQL is the supported GA v1 path.

Router metrics

Query execution:

NameTypeMeasuresLabels
sqp_queries_totalcounterCompleted queriespool, query_type, protocol, status
sqp_query_duration_secondshistogramQuery execution latencypool, query_type, protocol
sqp_query_rows_returnedhistogramRows returned per querypool, query_type
sqp_query_errors_totalcounterQuery errors by classified typepool, error_type
sqp_query_timeout_totalcounterQueries that hit a per-query or pool deadlinepool
sqp_errors_retryable_totalcounterErrors classified as transient (deadlock, timeout, lost connection)pool, error_type
sqp_errors_fatal_totalcounterErrors classified as permanent (syntax, constraint, permission)pool, error_type
sqp_result_bytes_totalcounterBytes returned in query resultspool, query_type

query_type is one of read, write, txn, ddl, admin, session, unknown. status is success or error.

Routing:

NameTypeMeasuresLabels
sqp_routing_decisions_totalcounterRouting decisions by kinddecision_type, target_pool
sqp_routing_duration_secondshistogramTime to make a routing decisiondecision_type
sqp_routing_cache_entriesgaugeRouting-cache sizenone
sqp_routing_cache_operations_totalcounterCache hits, misses, evictionsoperation
sqp_routing_rejects_totalcounterQueries rejected by a rulepool
sqp_translations_registeredgaugeRegistered translationsnone
sqp_translation_matches_totalcounterQueries matched by a translationtarget_pool

decision_type is one of translation, pattern, regex, default, pinned.

Connection pools and backends:

NameTypeMeasuresLabels
sqp_pool_connectionsgaugePooled connections by state (available, in_use)pool, state
sqp_pool_connections_maxgaugeConfigured connection ceilingpool
sqp_pool_acquire_totalcounterConnection acquisitions by outcome (reused, created, waited, timeout)pool, outcome
sqp_pool_acquire_duration_secondshistogramAcquire latencypool, outcome
sqp_pool_errors_totalcounterPool errorspool, error_type
sqp_pool_queue_depthgaugeRequests waiting for a connectionpool
sqp_pool_wait_duration_secondshistogramTime from request to acquisitionpool
sqp_pool_timeouts_totalcounterAcquire timeoutspool
sqp_pool_utilization_ratiogaugeIn-use over max connectionspool
sqp_pool_connection_lifetime_secondshistogramConnection lifetime at releasepool
sqp_backend_healthgaugeBackend health (1 healthy, 0 unhealthy)pool, backend
sqp_backend_connect_duration_secondshistogramBackend connect timepool, backend
sqp_backend_errors_totalcounterBackend errorspool, backend, error_type

Sessions and transactions:

NameTypeMeasuresLabels
sqp_sessions_activegaugeActive client sessionsprotocol
sqp_transactions_activegaugeOpen transactionspool
sqp_transaction_duration_secondshistogramTransaction duration at completionpool
sqp_transaction_idle_secondshistogramIdle time between queries inside a transactionpool
sqp_transaction_abandoned_totalcounterClients that disconnected mid-transactionpool
sqp_session_replay_failures_totalcounterSession-variable replay failurespool
sqp_session_auto_rollback_totalcounterAutomatic ROLLBACKs on session closepool
sqp_session_auto_rollback_failed_totalcounterAuto-ROLLBACKs that failed on the backendpool
sqp_auth_failures_totalcounterClient authentication failuresprotocol, reason

Protocol layer:

NameTypeMeasures
sqp_postgres_connections_created_totalcounterPostgreSQL backend connections opened
sqp_postgres_connections_closed_totalcounterPostgreSQL backend connections closed
sqp_postgres_connections_reset_totalcounterPostgreSQL backend connections reset for reuse
sqp_postgres_statements_prepared_totalcounterStatements prepared on PostgreSQL backends
sqp_postgres_execute_passthrough_totalcounterExecutes forwarded via raw passthrough
sqp_mysql_connections_created_totalcounterMySQL backend connections opened
sqp_mysql_connections_closed_totalcounterMySQL backend connections closed
sqp_mysql_connections_reset_totalcounterMySQL backend connections reset for reuse
sqp_mysql_connections_recovered_totalcounterMySQL connections recovered after streaming
sqp_mysql_statements_prepared_totalcounterStatements prepared on MySQL backends
sqp_mysql_streaming_task_panics_totalcounterMySQL streaming tasks that panicked
sqp_mysql_streaming_tasks_aborted_totalcounterMySQL streaming tasks aborted

Plugin chain metrics

Emitted by the Router's plugin chain for any registered plugin.

NameTypeMeasuresLabels
sqp_plugin_panic_totalcounterPlugin hooks that panicked (contained; the query proceeds per enforcement mode)plugin
sqp_plugin_timeout_totalcounterPlugin hooks that exceeded their time budgetplugin

Guard metrics

Emitted when [plugins.guard] is enabled.

NameTypeMeasuresLabels
sqp_guard_decisions_totalcounterDecisions by action (allow, block, amend, reroute)action, policy, trust_level
sqp_guard_decision_duration_secondshistogramDecision-pipeline latencyaction
sqp_guard_amendments_totalcounterQuery amendments applied (add_limit, add_timeout, force_read_only)type
sqp_guard_unanalyzable_totalcounterStatements Guard could not analyze; the alerting signal for unanalyzable_action = "log"source
sqp_guard_timeouts_totalcounterDecisions that blew the latency cap and failed opennone
sqp_guard_panics_totalcounterDecision-pipeline panics (contained)none
sqp_guard_registry_hits_totalcounterTrusted-query registry hitsnone
sqp_guard_registry_misses_totalcounterTrusted-query registry missesnone
sqp_guard_audit_dropped_totalcounterAudit records dropped because the channel was full or closednone
sqp_guard_audit_file_writes_totalcounterAudit records written by the file sinknone
sqp_guard_audit_file_write_errors_totalcounterFile-sink write failures (disk full, read-only mount)none
sqp_guard_audit_file_flush_errors_totalcounterFile-sink flush failuresnone
sqp_guard_audit_serialize_errors_totalcounterAudit records that failed to serializenone
sqp_guard_audit_sink_panics_totalcounterAudit-sink panics (record dropped)none

Accelerator metrics

Emitted when [plugins.accelerator] is enabled. The stalest-gauge alert pattern: watch time() - sqp_qp_last_success_timestamp_seconds; a stalled or repeatedly failing discovery loop stops advancing it while the proxy keeps serving.

NameTypeMeasuresLabels
sqp_qp_cycles_totalcounterCompleted discovery cycles by resultresult
sqp_qp_cycle_duration_secondshistogramDiscovery-cycle wall-clock durationnone
sqp_qp_errors_totalcounterCycle-stage errors (fail-open), including panicstage
sqp_qp_last_success_timestamp_secondsgaugeUnix time of the last fully successful cyclenone
sqp_qp_candidates_totalcounterCaching candidates surfaced by discoverynone
sqp_qp_rules_added_totalcounterRouting rules installed by the Acceleratornone
sqp_qp_rules_enabled_totalcounterRules enabled (for example after warmup)none
sqp_qp_rules_disabled_totalcounterRules disabled (for example on health failure)none
sqp_qp_rules_dropped_totalcounterRules removednone
sqp_qp_support_checks_totalcounterReadyset support checks by outcome (supported, unsupported, pending, cached, skipped, error)status
sqp_qp_caches_created_totalcounterReadyset caches created successfullynone

Analytics metrics

Served from the Analytics's own metrics endpoint.

Queries and connections:

NameTypeMeasuresLabels
sqp_duckdb_queries_totalcounterQueries on the PostgreSQL wire endpointquery_type, status
sqp_duckdb_query_duration_secondshistogramQuery latencyquery_type
sqp_duckdb_query_errors_totalcounterQuery errorserror_type
sqp_duckdb_connections_activegaugeActive client connectionsnone
sqp_duckdb_connections_totalcounterConnections accepted since startnone
sqp_duckdb_reader_queries_totalcounterQueries dispatched to read-pool connectionsreader
sqp_duckdb_reader_errors_totalcounterRead-pool dispatch errors (channel_full, disconnected)reader, error_type
sqp_duckdb_reader_pool_livegaugeLive readers in the read poolnone
sqp_duckdb_memory_bytesgaugeDuckDB memory usagenone
sqp_duckdb_database_size_bytesgaugeDatabase file sizenone

Replication and snapshots:

NameTypeMeasuresLabels
sqp_duckdb_replication_lag_secondsgaugeCDC replication lagnone
sqp_duckdb_tables_replicatedgaugeTables in the replication filternone
sqp_duckdb_snapshot_strategy_infogaugeInfo gauge (value 1) naming the active snapshot strategystrategy
sqp_snapshot_rows_totalcounterSnapshot rows completed per tabletable, strategy
sqp_snapshot_bytes_totalcounterSnapshot bytes completed per tabletable, strategy
sqp_snapshot_rows_estimated_totalgaugeEstimated total rows for the running snapshottable, strategy
sqp_snapshot_started_at_secondsgaugeUnix start time of the running snapshottable, strategy
sqp_snapshot_phasegaugeActive snapshot phase (1 for the current phase, 0 otherwise)table, strategy, phase

Parquet streaming snapshot pipeline (snapshot_strategy = "parquet_streaming"; see advanced snapshot tuning):

NameTypeMeasuresLabels
sqp_duckdb_parquet_snapshot_counter_mismatch_totalcounterRead/written/ingested row-counter disagreements at the reconciliation gatetable
sqp_duckdb_parquet_snapshot_writer_panic_totalcounterParquet writer panicstable
sqp_duckdb_parquet_snapshot_ingest_failure_totalcounterIngest insert failures by bounded reason (timeout, oom, schema_mismatch, constraint, other)table, reason
sqp_duckdb_parquet_snapshot_swap_failure_totalcounterFailed staging-to-target swapstable
sqp_duckdb_parquet_snapshot_swap_duration_secondshistogramStaging-to-target swap durationtable
sqp_duckdb_parquet_snapshot_scratch_pressure_totalcounterSnapshot aborts due to low scratch spacetable
sqp_duckdb_parquet_snapshot_preflight_warn_totalcounterScratch pre-flight checks skipped or warnednone
sqp_duckdb_parquet_snapshot_reconciliation_bypass_totalcounterSwaps performed with strict reconciliation disabled; alert on any increasenone
sqp_duckdb_orphan_staging_tables_reaped_totalcounterOrphan staging tables dropped by the startup reapernone
sqp_duckdb_parquet_snapshot_ingest_queue_depth_filesgaugeParquet files queued for ingesttable
sqp_duckdb_parquet_snapshot_ingest_queue_depth_bytesgaugeBytes queued for ingesttable
sqp_duckdb_parquet_snapshot_scratch_bytes_usedgaugeScratch disk in use by the snapshottable