Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(discover): Add trace response code to context array #6621

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions snuba/datasets/processors/transactions_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,14 @@ def _sanitize_contexts(
# Only top level scalar values within a context are written to the table. `data` is
# always a dict, so pop it from the context and move some values into the top level.
transaction_data = transaction_ctx.pop("data", None) or {}
if isinstance(transaction_data, dict) and "thread.id" in transaction_data:
# The thread.id can be either a str/int. Make sure to always convert to a str.
transaction_ctx["thread_id"] = str(transaction_data["thread.id"])
if isinstance(transaction_data, dict):
if "thread.id" in transaction_data:
# The thread.id can be either a str/int. Make sure to always convert to a str.
transaction_ctx["thread_id"] = str(transaction_data["thread.id"])
if "http.response.status_code" in transaction_data:
transaction_ctx["http.response.status_code"] = str(
transaction_data["http.response.status_code"]
)

# The hash and exclusive_time is being stored in the spans columns
# so there is no need to store it again in the context array.
Expand Down
Loading