Skip to content

Commit

Permalink
fix(meps): Only overwrite status code if int (#58251)
Browse files Browse the repository at this point in the history
When we fetch transaction.status results from metrics, the status code
that's returned back is not an int but rather a string with the value
we'd typically get if we resolve through the map. This causes issues
because for metrics responses, `transaction.status` gets set to `None`
for all rows.

This checks if the value is an int and if it is, fetch from the map,
otherwise don't overwrite it.
  • Loading branch information
narsaynorath authored Oct 17, 2023
1 parent 998b5c3 commit e88e83c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sentry/api/bases/organization_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def handle_data(
# once those APIs are used across the application.
if "transaction.status" in first_row:
for row in results:
if "transaction.status" in row:
if "transaction.status" in row and type(row["transaction.status"]) is int:
row["transaction.status"] = SPAN_STATUS_CODE_TO_NAME.get(
row["transaction.status"]
)
Expand Down

0 comments on commit e88e83c

Please sign in to comment.