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
104
104
$ span ->recordException ($ exception , [
105
105
TraceAttributes::EXCEPTION_ESCAPED => true ,
106
106
]);
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
+ }
108
110
}
109
111
110
112
if (null === $ response ) {
@@ -159,8 +161,7 @@ public static function register(): void
159
161
Span::getCurrent ()
160
162
->recordException ($ throwable , [
161
163
TraceAttributes::EXCEPTION_ESCAPED => true ,
162
- ])
163
- ->setStatus (StatusCode::STATUS_ERROR , $ throwable ->getMessage ());
164
+ ]);
164
165
165
166
return $ params ;
166
167
},
You can’t perform that action at this time.
0 commit comments