{"repo":"mstrYoda/pgtrace","free":true,"listed":false,"github":"https://github.com/mstrYoda/pgtrace","clone":"git clone https://github.com/mstrYoda/pgtrace.git","description":"Rust based Postgres extension that adds query lifecycle events to OTEL traces.","language":"Rust","stars":19,"topics":["database","jaeger","monitoring","observability","opentelemetry","postgresql","postgresql-extension","rust","tracing"],"license":null,"category":"analytics","readme_excerpt":"pg otel tracer OpenTelemetry tracing extension for PostgreSQL. Extracts W3C traceparent from SQL comments and exports query lifecycle spans via OTLP/HTTP. What It Does 1. Your app injects traceparent into SQL comments (sqlcommenter) 2. The extension intercepts query hooks ( planner , ExecutorStart , ExecutorRun , ExecutorEnd ) 3. Spans are batched in shared memory and exported asynchronously by a background worker 4. You see the full trace in Jaeger/Tempo — from HTTP handler down to Postgres internals Quick Start (Docker) This starts Postgres 16 + OTEL Collector + Jaeger + Go demo app. First build compiles the Rust extension inside the Postgres image (5–15 min). Manual Installation Prerequisites - Rust 1.70+ - cargo install cargo-pgrx --version 0.11.2 --locked - cargo pgrx init - PostgreSQL 13–16 dev headers Build & Install Configure PostgreSQL Add to postgresql.conf : Restart Postgres, then: Configuration Setting How to Set Default Description --------- ----------- --------- ------------- Enable/disable SELECT pg otel tracer set enabled(false) true Emergency off switch — no restart needed Sampling rate SELECT pg otel tracer set sample rate(0.1) 1.0 Fraction of queries to trace (0.0–1.0) OTLP endpoint OTEL EXPORTER OTLP ENDPOINT env var http://localhost:4318/v1/traces Where spans are sent Boot-time enable PG OTEL TRACER ENABLED env var true Initial state on server startup Boot-time sample rate PG OTEL TRACER SAMPLE RATE env var 1.0 Initial sampling rate Production Tuning Exam","default_branch":null,"files":null,"tree":[],"storefront":"/r/mstrYoda","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mstrYoda/pgtrace/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}