Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"brick/math": "^0.12 || ^0.13 || ^0.14 || ^0.15 || ^0.16 || ^0.17",
"coduo/php-humanizer": "^5.0",
"cuyz/valinor": "^2.4",
"doctrine/dbal": "^3.6 || ^4.0",
"doctrine/dbal": "^4.0",
"elasticsearch/elasticsearch": "^7.6|^8.0",
"google/apiclient": "^2.13",
"google/protobuf": "^4.0 || ^5.0",
Expand Down
170 changes: 85 additions & 85 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/adapter/etl-adapter-doctrine/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"require": {
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
"doctrine/dbal": "^3.6 || ^4.0",
"doctrine/dbal": "^4.0",
"flow-php/doctrine-dbal-bulk": "self.version",
"flow-php/etl": "self.version"
},
Expand Down
4 changes: 2 additions & 2 deletions src/bridge/symfony/telemetry-bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"symfony/polyfill-mbstring": "^1.33"
},
"require-dev": {
"doctrine/dbal": "^3.6 || ^4.0",
"doctrine/dbal": "^4.0",
"flow-php/psr18-telemetry-bridge": "self.version",
"flow-php/telemetry-otlp-bridge": "self.version",
"nyholm/psr7": "^1.8",
Expand All @@ -38,7 +38,7 @@
"twig/twig": "^3.0"
},
"suggest": {
"doctrine/dbal": "Required for Doctrine DBAL tracing (^3.6 or ^4.0)",
"doctrine/dbal": "Required for Doctrine DBAL tracing (^4.0)",
"flow-php/psr18-telemetry-bridge": "Required for PSR-18 HTTP client tracing",
"flow-php/telemetry-otlp-bridge": "Required for OTLP exporter support",
"symfony/messenger": "Required for Messenger tracing middleware",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

namespace Flow\Bridge\Symfony\TelemetryBundle\DependencyInjection\Compiler;

use Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL\TracingDriver;
use Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL\TracingMiddleware;
use Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL\V3\TracingDriver as V3TracingDriver;
use Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL\V4\TracingDriver as V4TracingDriver;
use Flow\Telemetry\Telemetry;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -15,13 +14,10 @@

use function array_keys;
use function count;
use function interface_exists;
use function preg_match;

final class DBALTelemetryPass implements CompilerPassInterface
{
private const string VERSION_AWARE_PLATFORM_DRIVER = 'Doctrine\\DBAL\\VersionAwarePlatformDriver';

public function process(ContainerBuilder $container): void
{
if (!$container->hasParameter('flow.telemetry.dbal.enabled')) {
Expand All @@ -45,7 +41,6 @@ public function process(ContainerBuilder $container): void
? $container->getParameter('flow.telemetry.dbal.exclude_connections')
: [];

$driverClass = $this->resolveDriverClass();
$connectionNames = $this->findConnectionNames($container);

foreach ($connectionNames as $connectionName) {
Expand All @@ -57,7 +52,7 @@ public function process(ContainerBuilder $container): void

$definition = new Definition(TracingMiddleware::class);
$definition->setArgument(0, new Reference(Telemetry::class));
$definition->setArgument(1, $driverClass);
$definition->setArgument(1, TracingDriver::class);
$definition->setArgument(2, $connectionName);
$definition->setArgument(3, $logSql);
$definition->setArgument(4, $maxSqlLength);
Expand Down Expand Up @@ -114,16 +109,4 @@ private function matchesPattern(string $connectionName, string $pattern): bool

return $connectionName === $pattern;
}

/**
* @return class-string
*/
private function resolveDriverClass(): string
{
if (interface_exists(self::VERSION_AWARE_PLATFORM_DRIVER)) {
return V3TracingDriver::class;
}

return V4TracingDriver::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL\V3;
namespace Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL;

use DateTimeImmutable;
use Doctrine\DBAL\Driver\Connection as ConnectionInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL\V4;
namespace Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL;

use DateTimeImmutable;
use Doctrine\DBAL\Connection\StaticServerVersionProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL\V3;
namespace Flow\Bridge\Symfony\TelemetryBundle\Instrumentation\Doctrine\DBAL;

use DateTimeImmutable;
use Doctrine\DBAL\Driver\Middleware\AbstractStatementMiddleware;
Expand Down

This file was deleted.

Loading
Loading