tbachert / otel-instrumentation-doctrine-dbal
OpenTelemetry doctrine/dbal instrumentation
dev-main / 0.1.x-dev
2025-03-16 20:32 UTC
Requires
- php: ^8.2
- composer-runtime-api: ^2.0
- ext-mbstring: *
- doctrine/dbal: ^4.0
- open-telemetry/api: ^1.1
- phpmyadmin/sql-parser: ^6.0
Requires (Dev)
- phpunit/phpunit: ^11.3
- tbachert/otel-sdk: ^0.1
This package is auto-updated.
Last update: 2025-03-16 20:32:55 UTC
README
Installation
composer require tbachert/otel-instrumentation-doctrine-dbal
Usage
Manual registration
use Doctrine\DBAL\Configuration; use Doctrine\DBAL\DriverManager; use Nevay\OTelInstrumentation\DoctrineDbal\TracingMiddleware; $config = new Configuration(); $config->setMiddlewares([ new TracingMiddleware($tracerProvider), ]); $connection = DriverManager::getConnection($params, $config);
Automatic registration
The tracing middleware is automatically injected if auto-instrumentation is enabled for the project.
Disabling instrumentation via config file
instrumentation: php: doctrine: false