New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

open-telemetry/opentelemetry-auto-postgresql

OpenTelemetry auto-instrumentation for postgresql
24,068 1

Larablocks Analysis

open-telemetry/opentelemetry-auto-postgresql works with any PHP project: the latest release (0.4.1, Sep 2, 2026) doesn't depend on Laravel.

Recommendation checks

Solid choice

Solid choice: maintained and up to date, meets 1 of 3 checks; below the bar for Recommended on use.

  • Released in the last 12 months (Sep 2, 2026)
  • 5,869 downloads a month (needs 10,000)
  • 1 GitHub star (needs 100)

State

Maintained
  • Last stable release: Sep 2, 2026.
  • 2 releases in the last 12 months.
  • First released: Jun 29, 2026.
  • Monthly downloads: 5,869, up 408% from six months ago.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.

Install
composer require open-telemetry/opentelemetry-auto-postgresql
Latest Version:0.4.1
PHP:^8.2
License:Apache-2.0
Last Updated:Nov 14, 2026
Links: GitHub  ·  Packagist
Maintainer: brettmc

Releases Issues Source Mirror Latest Version Stable CI

This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

OpenTelemetry PostgreSQL auto-instrumentation

Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.

Overview

This package provides auto-instrumentation for the PostgreSQL native PHP extension (ext-pgsql). Hooks are registered via Composer, and client spans are automatically created for key database operations.

Supported functions include:

Connection

  • pg_connect
  • pg_pconnect

Queries

  • pg_query
  • pg_query_params
  • pg_send_query
  • pg_send_query_params
  • pg_get_result

Prepared Statements

  • pg_prepare
  • pg_send_prepare
  • pg_execute
  • pg_send_execute

Table/Row Operations

  • pg_insert
  • pg_select
  • pg_update
  • pg_delete

COPY

  • pg_copy_from
  • pg_copy_to

Large Objects (LOB)

  • pg_lo_create
  • pg_lo_open
  • pg_lo_write
  • pg_lo_read
  • pg_lo_read_all
  • pg_lo_unlink
  • pg_lo_import
  • pg_lo_export

Configuration

Disabling PostgreSQL instrumentation

The extension can be disabled via runtime configuration:

OTEL_PHP_DISABLED_INSTRUMENTATIONS=postgresql

Database Context Propagation

Enable context propagation for database queries by installing the following packages:

composer require open-telemetry/opentelemetry-sqlcommenter

Currently, only the following functions support context propagation:

  • pg_query
  • pg_send_query

Compatibility

PHP 8.2 or newer is required

Alternatives to open-telemetry/opentelemetry-auto-postgresql

cboxdk/laravel-telemetry

Collector-free telemetry for Laravel: Prometheus metrics, OTLP traces and events...

24,031 3
mliviu79/laravel-langfuse-prism

Seamless integration of Langfuse observability for Laravel and Laravel Prism.

5,844 3
cristea-iulian/laravel-ai-otel

OpenTelemetry tracing for the Laravel AI SDK, following the OpenTelemetry GenAI...

1,501 6

Version History

Version Released PHP License
0.4.1 ^8.2 Apache-2.0
0.4.0 ^8.2 Apache-2.0