diff --git a/potal/internal/potalhttp/client.go b/potal/internal/potalhttp/client.go index f06f4aba..b82e0040 100644 --- a/potal/internal/potalhttp/client.go +++ b/potal/internal/potalhttp/client.go @@ -52,6 +52,10 @@ func SendRequest(ctx context.Context, e event.PotalEvent) error { } defer res.Body.Close() + span.Data = map[string]interface{}{ + "http.response.status_code": res.StatusCode, + } + switch res.StatusCode { case http.StatusOK: span.Status = sentry.SpanStatusOK diff --git a/src/Http/Client.php b/src/Http/Client.php index f2072f7b..e92fdae3 100644 --- a/src/Http/Client.php +++ b/src/Http/Client.php @@ -41,8 +41,12 @@ protected function _sendRequest(RequestInterface $request, array $options): Resp $response = parent::_sendRequest($request, $options); if ($span !== null) { - $span->setHttpStatus($response->getStatusCode()); - $span->finish(); + $span + ->setHttpStatus($response->getStatusCode()) + ->setData([ + 'http.response.status_code' => $response->getStatusCode(), + ]) + ->finish(); } return $response;