open-telemetry/opentelemetry-auto-mysqli

OpenTelemetry auto-instrumentation for mysqli

Package info

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

Homepage

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

Statistics

Installs: 79 983

Dependents: 0

Suggesters: 0

Stars: 0

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 70c00aa415f756742e22fb68a753557c517af5f5

mysqlmysqliinstrumentationtracingopentelemetryopen-telemetryotel

This package is auto-updated.

Last update: 2026-06-27 10:38:25 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 mysqli 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 client kind spans will automatically be created when calling following functions or methods:

  • mysqli_connect

  • mysqli::__construct

  • mysqli::connect

  • mysqli_real_connect

  • mysqli::real_connect

  • mysqli_query

  • mysqli::query

  • mysqli_real_query

  • mysqli::real_query

  • mysqli_execute_query

  • mysqli::execute_query

  • mysqli_multi_query

  • mysqli::multi_query

  • mysqli_next_result

  • mysqli::next_result

  • mysqli_begin_transaction

  • mysqli::begin_transaction

  • mysqli_rollback

  • mysqli::rollback

  • mysqli_commit

  • mysqli::commit

  • mysqli_stmt_execute

  • mysqli_stmt::execute

  • mysqli_stmt_next_result

  • mysqli_stmt::next_result

Configuration

Disabling mysqli instrumentation

The extension can be disabled via runtime configuration:

OTEL_PHP_DISABLED_INSTRUMENTATIONS=mysqli

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:

  • mysqli::query
  • mysqli_query
  • mysqli::real_query
  • mysqli_real_query