January 31, 2026
Trace me maybe
pg_tracing: Distributed Tracing for PostgreSQL
Postgres adds trace tools—fans buzz, critics say 'abandoned' and 'not distributed'
TLDR: DataDog’s pg_tracing adds server-side tracking to Postgres so you can see what queries do, but it’s early and possibly unstable. The crowd is split: some want it in core or adopted by Sentry, while others call it “abandoned” and say the “distributed” label oversells it.
Postgres just got a new add‑on called pg_tracing that promises to put your database in “detective mode,” recording what happens during slow or weird queries. It’s made by DataDog and can spit out trace data as records or simple JSON, then ship it to an OpenTelemetry collector (that’s the standard way to track what apps are doing). Sounds slick—but the crowd is already fighting about it.
On the hype side, dujuku is dreaming of this going into Postgres itself, calling it a “gamechanger” for catching those mysterious long‑running transactions that ruin weekends. Meanwhile, deepsun brought the salt: “There’s nothing ‘distributed’ about it,” accusing the project of overpromising on the title. That sparked a mini‑meme of people joking it’s “distributed like my laundry”—trace data goes out, but the database doesn’t magically become distributed.
Then brunoqc drops the hammer: “It looks abandoned,” triggering eye‑rolls and “is this vaporware?” gifs. Not all doom, though—9dev is basically summoning Sentry with a “pick this up!” spell, imagining a world where your app traces and your Postgres traces line up like true crime corkboard strings.
Verdict: exciting idea, early and a bit shaky, with the community split between dreamers, nitpickers, and adoption wish‑casters.
Key Points
- •pg_tracing is a PostgreSQL extension that generates server-side spans for sampled queries to aid tracing and observability.
- •Spans can be retrieved via SQL views (pg_tracing_consume_spans, pg_tracing_peek_spans) or exported as OTLP JSON using pg_tracing_json_spans.
- •Trace context propagation is supported via SQLCommenter or the GUC parameter pg_tracing.trace_context.
- •The extension requires configuration through shared_preload_libraries and supports PostgreSQL versions 14–16; it is still in early development.
- •pg_tracing traces events including internal functions, SQL and utility statements, execution plan nodes, nested queries, triggers, parallel workers, and transaction commit, with memory use tied to pg_tracing.max_span.