diff --git a/src/Aspect/HttpClientAspect.php b/src/Aspect/HttpClientAspect.php index 42699b5..40602ff 100644 --- a/src/Aspect/HttpClientAspect.php +++ b/src/Aspect/HttpClientAspect.php @@ -77,7 +77,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) try { $result = $proceedingJoinPoint->process(); if ($result instanceof ResponseInterface) { - $span->setTag($this->spanTagManager->get('http_client', 'http.status_code'), $result->getStatusCode()); + $span->setTag($this->spanTagManager->get('http_client', 'http.status_code'), (string) $result->getStatusCode()); } } catch (Throwable $e) { if ($this->switchManager->isEnable('exception') && ! $this->switchManager->isIgnoreException($e)) { diff --git a/src/Listener/RequestTraceListener.php b/src/Listener/RequestTraceListener.php index 5cbf008..2ef8056 100644 --- a/src/Listener/RequestTraceListener.php +++ b/src/Listener/RequestTraceListener.php @@ -81,7 +81,7 @@ protected function handleRequestTerminated(RequestTerminated $event): void $this->appendExceptionToSpan($span, $exception = $event->exception); if ($exception instanceof HttpException) { - $span->setTag($this->spanTagManager->get('response', 'status_code'), $exception->getStatusCode()); + $span->setTag($this->spanTagManager->get('response', 'status_code'), (string) $exception->getStatusCode()); } } diff --git a/src/Middleware/TraceMiddleware.php b/src/Middleware/TraceMiddleware.php index 40009cc..f9ad3fb 100644 --- a/src/Middleware/TraceMiddleware.php +++ b/src/Middleware/TraceMiddleware.php @@ -77,7 +77,7 @@ protected function appendExceptionToSpan(Span $span, Throwable $exception): void $span->setTag('error', true); $span->setTag($this->spanTagManager->get('exception', 'class'), get_class($exception)); $span->setTag($this->spanTagManager->get('exception', 'code'), $exception->getCode()); - $span->setTag($this->spanTagManager->get('exception', 'message'), $exception->getMessage()); + $span->setTag($this->spanTagManager->get('exception', 'message'), (string) $exception->getMessage()); $span->setTag($this->spanTagManager->get('exception', 'stack_trace'), (string) $exception); }