Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions src/Instrumentation/Doctrine/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"config": {
"allow-plugins": {
"php-http/discovery": false,
"tbachert/spi": true
"tbachert/spi": false
}
}
}
}
11 changes: 8 additions & 3 deletions src/Instrumentation/Doctrine/src/AttributesResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '.'));

Expand All @@ -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;
}

/**
Expand Down
Loading