Skip to content

Commit

Permalink
obs(snuba): add bytes scanned measurement to snuba spans (#86113)
Browse files Browse the repository at this point in the history
add how many bytes were scanned to each span for easier debugging
  • Loading branch information
volokluev authored Feb 28, 2025
1 parent 341da7d commit 774b748
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sentry/utils/snuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,9 @@ def _bulk_snuba_query(snuba_requests: Sequence[SnubaRequest]) -> ResultSet:
raise UnexpectedResponseError(f"Could not decode JSON response: {response.data!r}")

allocation_policy_prefix = "allocation_policy."
bytes_scanned = body.get("profile", {}).get("progress_bytes", None)
if bytes_scanned is not None:
span.set_measurement(f"{allocation_policy_prefix}.bytes_scanned", bytes_scanned)
if _is_rejected_query(body):
quota_allowance_summary = body["quota_allowance"]["summary"]
for k, v in quota_allowance_summary.items():
Expand Down

0 comments on commit 774b748

Please sign in to comment.