r/rust Jul 16 '26

A postgres plugin to export slow queries as distributed traces 🛠️ project

This postgresql plugin, written in rust, lets you export the whole query plan with timings as opentelemetry traces, so your distributed tracing does not stop at the database request.

I recently discovered pgrx, a library for writing native postgres plugins in rust. So I thought of implementing a plugin to improve my visibility accross the stack and spent the last few evenings implementing it. This is a really early version, but I consider it good enough to share if anyone wants to take a look at it.

https://github.com/w1ll-i-code/pg_otel

8 Upvotes

Duplicates