From 605c11e8e142b4c4bc9db48753f7e2ad9577ef47 Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Tue, 25 Feb 2025 16:04:37 +0100 Subject: [PATCH] Attach the response code as an data attribute --- src/Sentry/Laravel/Tracing/Middleware.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Sentry/Laravel/Tracing/Middleware.php b/src/Sentry/Laravel/Tracing/Middleware.php index d10ca91d..13caacd4 100644 --- a/src/Sentry/Laravel/Tracing/Middleware.php +++ b/src/Sentry/Laravel/Tracing/Middleware.php @@ -234,6 +234,9 @@ private function addBootDetailTimeSpans(Span $bootstrap): void private function hydrateResponseData(SymfonyResponse $response): void { $this->transaction->setHttpStatus($response->getStatusCode()); + $this->transaction->setData([ + 'http.response.status_code' => $response->getStatusCode(), + ]); } public function finishTransaction(): void