postgres=# select * from sessions where video_id = '3Gtuc2lnnsE';

Wait-event tracing, part 1

· 60:12 · Observability

pg_wait_tracer, core timing, USDT probes, and observer-effect trade-offs.

session summary

Dmitri Fomin demonstrated pg_wait_tracer, an eBPF-based tool that captures every Postgres wait-event transition with microsecond-to-nanosecond timestamps, replayable trace files, latency heatmaps, and query drill-down. The motivating case was intermittent primary-key lookups jumping from milliseconds to a one-second timeout. The group identified inlined pgstat_report_wait_start/end calls as the obstacle to ordinary probes, produced a small USDT-probe prototype, and planned worst-case overhead benchmarks before proposing always-on core instrumentation.

timecodes

  1. ASH, wait-event gaps, and pg_wait_tracer
  2. The intermittent one-second query mystery
  3. Sampling versus complete wait tracing
  4. Finding a trace path with hardware watchpoints
  5. Live ASH-style trace visualization
  6. Latency heatmaps and source-code attribution
  7. Transition chains for root-cause analysis
  8. USDT probes, core patch, and benchmark plan