Skip to content

Commit

Permalink
fix: server span logic should always be executed if recording
Browse files Browse the repository at this point in the history
  • Loading branch information
omgitsaheadcrab committed Aug 21, 2024
1 parent 9daafa7 commit 9c32d80
Showing 1 changed file with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -868,25 +868,25 @@ async def otel_send(message: dict[str, Any]):
self._sem_conv_opt_in_mode,
)

if (
server_span.is_recording()
and server_span.kind == trace.SpanKind.SERVER
and "headers" in message
):
custom_response_attributes = (
collect_custom_headers_attributes(
message,
self.http_capture_headers_sanitize_fields,
self.http_capture_headers_server_response,
normalise_response_header_name,
)
if self.http_capture_headers_server_response
else {}
)
if len(custom_response_attributes) > 0:
server_span.set_attributes(
custom_response_attributes
)
if (
server_span.is_recording()
and server_span.kind == trace.SpanKind.SERVER
and "headers" in message
):
custom_response_attributes = (
collect_custom_headers_attributes(
message,
self.http_capture_headers_sanitize_fields,
self.http_capture_headers_server_response,
normalise_response_header_name,
)
if self.http_capture_headers_server_response
else {}
)
if len(custom_response_attributes) > 0:
server_span.set_attributes(
custom_response_attributes
)

if status_code:
set_status_code(
Expand Down

0 comments on commit 9c32d80

Please sign in to comment.