Skip to content

chore(integrations): Halting events to be logged as warning#113104

Open
armenzg wants to merge 1 commit intomasterfrom
mark_as_warning
Open

chore(integrations): Halting events to be logged as warning#113104
armenzg wants to merge 1 commit intomasterfrom
mark_as_warning

Conversation

@armenzg
Copy link
Copy Markdown
Member

@armenzg armenzg commented Apr 15, 2026

It will make it a bit more obvious in the UI that something went wrong.

@armenzg armenzg requested review from a team as code owners April 15, 2026 20:13
@armenzg armenzg self-assigned this Apr 15, 2026
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 15, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Redundant conditional branches with identical logic
    • Removed redundant if/elif branches that both called logger.warning() with identical parameters, replacing them with a single logger.warning() call.

Create PR

Or push these changes by commenting:

@cursor push d25e03ab6e
Preview (d25e03ab6e)
diff --git a/src/sentry/integrations/utils/metrics.py b/src/sentry/integrations/utils/metrics.py
--- a/src/sentry/integrations/utils/metrics.py
+++ b/src/sentry/integrations/utils/metrics.py
@@ -207,10 +207,7 @@
                 effective_sample_log_rate >= 1.0 or random.random() < effective_sample_log_rate
             )
             if should_log:
-                if outcome == EventLifecycleOutcome.FAILURE:
-                    logger.warning(key, **log_params)
-                elif outcome == EventLifecycleOutcome.HALTED:
-                    logger.warning(key, **log_params)
+                logger.warning(key, **log_params)
 
     @staticmethod
     def _report_flow_error(message) -> None:

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 10c7abe. Configure here.

logger.warning(key, **log_params)
elif outcome == EventLifecycleOutcome.HALTED:
logger.info(key, **log_params)
logger.warning(key, **log_params)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Redundant conditional branches with identical logic

Low Severity

The if/elif on lines 210–213 now has two branches that both call logger.warning(key, **log_params). After changing HALTED from logger.info to logger.warning, the conditional is redundant — a single logger.warning(key, **log_params) call (without the branching) would behave identically. Keeping the duplicate branches adds maintenance risk: a future change to one branch could accidentally diverge from the other.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 10c7abe. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant