otel_api
postgres_otel_api · Shared OpenTelemetry trace-context and producer/exporter API
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102136 | otel_api | postgres_otel_api | 0.1.1 | STAT | PostgreSQL | C |
PostgreSQL · 14, 15, 16, 17, 18
Usage
Sources:
otel_api provides common trace-context state and a C rendezvous API for instrumentation and exporters. It does not itself ship traces over OTLP or create query spans without an instrumentation consumer.
Core Workflow
Operational Boundaries
Load the API at backend start. otel_api.traceparent and otel_api.tracestate carry context through the GUC fallback; otel_current_traceparent() is the optional SQL inspection helper installed by CREATE EXTENSION. Creating its C SQL function requires a superuser. Pair the library with otel_postgres_tracing for query instrumentation and an exporter to consume spans.
The project is pre-release: wire and file formats may change. Stock PostgreSQL 14+ supports the GUC/sqlcommenter fallback; protocol-header propagation and some error/parallel-worker behavior require the companion patched PostgreSQL. Do not assume those patches are present on an ordinary server. Append libraries to existing preload entries and restart for cluster-wide enablement. Protect traces because statement text and attributes may contain sensitive data.