open-telemetry/opentelemetry-auto-pdo

OpenTelemetry auto-instrumentation for PDO

Package info

github.com/opentelemetry-php/contrib-auto-pdo

Homepage

pkg:composer/open-telemetry/opentelemetry-auto-pdo

Statistics

Installs: 1 672 808

Dependents: 2

Suggesters: 1

Stars: 11

0.4.0 2026-03-24 16:33 UTC

Requires

Suggests

  • ext-mbstring: For better performance than symfony/polyfill-mbstring

Provides

None

Conflicts

None

Replaces

None

Apache-2.0 c5a824b3f46f3c1eca653149f59c06edb7fb94ac

pdoinstrumentationtracingopentelemetryopen-telemetryotel

This package is auto-updated.

Last update: 2026-06-08 12:54:37 UTC


README

👁 Releases
👁 Issues
👁 Source
👁 Mirror
👁 Latest Version
👁 Stable

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

OpenTelemetry PDO (PHP DataObjects) auto-instrumentation

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

Overview

Auto-instrumentation hooks are registered via composer, and spans will automatically be created for selected PDO and PDOStatement methods.

Configuration

The extension can be disabled via runtime configuration:

OTEL_PHP_DISABLED_INSTRUMENTATIONS=pdo

In case UI used to view telemetry data does not support links between spans (for example newrelic), you can optionally enable setting db statements attribute to fetchAll and execute spans using configuration directive:

otel.instrumentation.pdo.distribute_statement_to_linked_spans = true

or environment variable:

OTEL_PHP_INSTRUMENTATION_PDO_DISTRIBUTE_STATEMENT_TO_LINKED_SPANS=true

Database Context Propagation

Enable context propagation for database queries (pdo_mysql, pdo_pgsql only) by installing the following packages:

composer require open-telemetry/opentelemetry-sqlcommenter

Currently, only the following functions support context propagation:

  • PDO::query
  • PDO::exec