tbachert/otel-instrumentation-doctrine-dbal

OpenTelemetry doctrine/dbal instrumentation

dev-main / 0.1.x-dev 2025-03-16 20:32 UTC

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