Modern PostgreSQL workloads demand deep visibility into query behavior yet traditional logging and monitoring approaches often introduce significant overhead or fail to provide actionable intelligence.
This session introduces Pgtrace, a lightweight open-source PostgreSQL extension that hooks directly into the executor to capture aggregate query metrics in shared memory with minimal performance impact.
Pgtrace provides:
Per-query fingerprinting with detailed execution statistics
Global metrics for total, failed, and slow queries
A built-in latency histogram
Slow query capture with execution context
SQLSTATE-based failure tracking
Detection of anomalous, inefficient, and previously unseen (“alien”) queries
Unlike heavy external monitoring systems, Pgtrace is intentionally minimal by design, prioritizing low overhead and cross-backend shared memory metrics.