Skip to content

otel_postgres_tracing

Query and utility-statement tracing through otel_api

postgres_otel_api · Query and utility-statement tracing through otel_api

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
102137otel_postgres_tracingpostgres_otel_api0.1.1STATPostgreSQLC

PostgreSQL · 14, 15, 16, 17, 18

Relationships
Requiresotel_api

Usage

Sources:

otel_postgres_tracing instruments query execution and utility statements through PostgreSQL hooks, using the shared otel_api provider. An exporter is needed to persist or send the produced spans.

Core Workflow

shared_preload_libraries = 'otel_api,otel_postgres_tracing,otel_demo_exporter'
otel_demo_exporter.output_file = '/var/log/postgresql/otel_spans.jsonl'

Operational Boundaries

The library installs hooks when loaded. Cluster preload is the recommended path; per-session loading is best-effort and affects only that backend. The versioned SQL contains no user-facing SQL objects, so CREATE EXTENSION is optional bookkeeping, not activation. Preload ordering with the API is not significant in this revision.

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.

Table reader