We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a632a81 commit a394e2fCopy full SHA for a394e2f
1 file changed
sentry_sdk/integrations/httpx.py
@@ -205,12 +205,13 @@ async def send(
205
else:
206
request.headers[key] = value
207
208
- rv = await real_send(self, request, **kwargs)
209
-
210
- streamed_span.status = "error" if rv.status_code >= 400 else "ok"
211
- attributes["http.response.status_code"] = rv.status_code
+ try:
+ rv = await real_send(self, request, **kwargs)
212
213
- streamed_span.set_attributes(attributes)
+ streamed_span.status = "error" if rv.status_code >= 400 else "ok"
+ attributes["http.response.status_code"] = rv.status_code
+ finally:
214
+ streamed_span.set_attributes(attributes)
215
216
# Needs to happen within the context manager as we want to attach the
217
# final data before the span finishes and is sent for ingesting.
0 commit comments