Skip to content
Merged
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions src/Instrumentation/Symfony/src/SymfonyInstrumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ public static function register(): void
$span->recordException($exception, [
TraceAttributes::EXCEPTION_ESCAPED => true,
]);
$span->setStatus(StatusCode::STATUS_ERROR, $exception->getMessage());
if(null !== $response && $response->getStatusCode() >= Response::HTTP_INTERNAL_SERVER_ERROR) {
$span->setStatus(StatusCode::STATUS_ERROR, $exception->getMessage());
}
}

if (null === $response) {
Expand Down Expand Up @@ -159,8 +161,7 @@ public static function register(): void
Span::getCurrent()
->recordException($throwable, [
TraceAttributes::EXCEPTION_ESCAPED => true,
])
->setStatus(StatusCode::STATUS_ERROR, $throwable->getMessage());
]);

return $params;
},
Expand Down
Loading