We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3564988 commit be97d9dCopy full SHA for be97d9d
src/SymfonyInstrumentation.php
@@ -61,6 +61,16 @@ public static function register(): void
61
}
62
$scope->detach();
63
$span = Span::fromContext($scope->context());
64
+
65
+ $request = ($params[0] instanceof Request) ? $params[0] : null;
66
+ if (null !== $request) {
67
+ $routeName = $request->attributes->get('_route', '');
68
69
+ if ('' !== $routeName) {
70
+ $span->setAttribute(TraceAttributes::HTTP_ROUTE, $routeName);
71
+ }
72
73
74
if ($exception) {
75
$span->recordException($exception, [TraceAttributes::EXCEPTION_ESCAPED => true]);
76
$span->setStatus(StatusCode::STATUS_ERROR, $exception->getMessage());
0 commit comments