diff --git a/src/Instrumentation/Doctrine/composer.json b/src/Instrumentation/Doctrine/composer.json index 5bb13b3d0..352fe07d3 100644 --- a/src/Instrumentation/Doctrine/composer.json +++ b/src/Instrumentation/Doctrine/composer.json @@ -49,7 +49,7 @@ "config": { "allow-plugins": { "php-http/discovery": false, - "tbachert/spi": true + "tbachert/spi": false } } -} +} \ No newline at end of file diff --git a/src/Instrumentation/Doctrine/src/AttributesResolver.php b/src/Instrumentation/Doctrine/src/AttributesResolver.php index b3731d2be..6ca182fc2 100644 --- a/src/Instrumentation/Doctrine/src/AttributesResolver.php +++ b/src/Instrumentation/Doctrine/src/AttributesResolver.php @@ -41,7 +41,7 @@ final class AttributesResolver 'trino', ]; - public static function get(string $attributeName, array $params): string + public static function get(string $attributeName, array $params): string|int|null { $method = 'get' . str_replace('.', '', ucwords($attributeName, '.')); @@ -63,9 +63,14 @@ private static function getServerAddress(array $params): string /** * Resolve attribute `server.port` */ - private static function getServerPort(array $params): string + private static function getServerPort(array $params): ?int { - return $params[1][0]['port'] ?? 'unknown'; + $port = $params[1][0]['port'] ?? null; + if ($port) { + $port = (int) $port; + } + + return $port; } /**