Skip to content

Commit

Permalink
fix(sdk): Discard generic redirects (#64945)
Browse files Browse the repository at this point in the history
Discard generic redirects in `before_send_transaction` until
getsentry/team-sdks#48 is done.
  • Loading branch information
jjbayer authored Feb 9, 2024
1 parent 70898e1 commit 6eb78ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sentry/utils/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ def traces_sampler(sampling_context):


def before_send_transaction(event, _):
# Discard generic redirects.
# This condition can be removed once https://github.com/getsentry/team-sdks/issues/48 is fixed.
if (
event.get("tags", {}).get("http.status_code") == "301"
and event.get("transaction_info", {}).get("source") == "url"
):
return None

# Occasionally the span limit is hit and we drop spans from transactions, this helps find transactions where this occurs.
num_of_spans = len(event["spans"])
event["tags"]["spans_over_limit"] = num_of_spans >= 1000
Expand Down

0 comments on commit 6eb78ab

Please sign in to comment.