File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/Instrumentation/Symfony/src Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,9 @@ public static function register(): void
104104 $ span ->recordException ($ exception , [
105105 TraceAttributes::EXCEPTION_ESCAPED => true ,
106106 ]);
107- $ span ->setStatus (StatusCode::STATUS_ERROR , $ exception ->getMessage ());
107+ if (null !== $ response && $ response ->getStatusCode () >= Response::HTTP_INTERNAL_SERVER_ERROR ) {
108+ $ span ->setStatus (StatusCode::STATUS_ERROR , $ exception ->getMessage ());
109+ }
108110 }
109111
110112 if (null === $ response ) {
@@ -159,8 +161,7 @@ public static function register(): void
159161 Span::getCurrent ()
160162 ->recordException ($ throwable , [
161163 TraceAttributes::EXCEPTION_ESCAPED => true ,
162- ])
163- ->setStatus (StatusCode::STATUS_ERROR , $ throwable ->getMessage ());
164+ ]);
164165
165166 return $ params ;
166167 },
You can’t perform that action at this time.
0 commit comments