chore(integrations): Halting events to be logged as warning#113104
chore(integrations): Halting events to be logged as warning#113104
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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.
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) |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 10c7abe. Configure here.



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