Skip to content
Merged
Changes from 1 commit
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
9 changes: 5 additions & 4 deletions src/sentry/discover/compare_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,11 @@ def assert_timeseries_close(aligned_timeseries, alert_rule):
"confidence": values.get("confidence"),
}

sentry_sdk.set_tag("false_positive_misfires", false_positive_misfire)
sentry_sdk.set_tag("false_negative_misfires", false_negative_misfire)
for trigger_action_type, count in trigger_action_types.items():
sentry_sdk.set_tag(f"trigger_action_type.{trigger_action_type}", count)
with sentry_sdk.isolation_scope() as scope:
scope.set_tag("false_positive_misfires", false_positive_misfire)
scope.set_tag("false_negative_misfires", false_negative_misfire)
for trigger_action_type, count in trigger_action_types.items():
scope.set_tag(f"trigger_action_type.{trigger_action_type}", count)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Misfire tags captured in scope with no event

The isolation scope at lines 330-334 sets misfire and trigger action tags but doesn't capture any event within that scope. The tags exit the scope without being associated with any Sentry event, making them ineffective. These tags should either be moved into the isolation scope where capture_message is called at line 352, or capture_message should be called within this scope.

Fix in Cursor Fix in Web


if mismatches:
with sentry_sdk.isolation_scope() as scope:
Expand Down
Loading