Skip to content

Commit

Permalink
Update _semconv.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lzchen authored Jul 11, 2024
1 parent c75e732 commit 06fffb1
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,16 @@ def _set_status(
sem_conv_opt_in_mode,
):
if status_code < 0:
metrics_attributes[ERROR_TYPE] = status_code_str
if span.is_recording():
if _report_new(sem_conv_opt_in_mode):
if span.is_recording():
span.set_attribute(ERROR_TYPE, status_code_str)
metrics_attributes[ERROR_TYPE] = status_code_str

span.set_status(
Status(
StatusCode.ERROR,
"Non-integer HTTP status: " + status_code_str,
span.set_attribute(ERROR_TYPE, status_code_str)
span.set_status(
Status(
StatusCode.ERROR,
"Non-integer HTTP status: " + status_code_str,
)
)
)
else:
status = http_status_to_status_code(status_code, server_span=True)

Expand All @@ -381,7 +380,8 @@ def _set_status(
if span.is_recording():
span.set_attribute(ERROR_TYPE, status_code_str)
metrics_attributes[ERROR_TYPE] = status_code_str
span.set_status(Status(status))
if span.is_recording():
span.set_status(Status(status))


# Get schema version based off of opt-in mode
Expand Down

0 comments on commit 06fffb1

Please sign in to comment.