diff --git a/src/sentry/integrations/utils/metrics.py b/src/sentry/integrations/utils/metrics.py index 6bfa1e24f0d855..153e1813bb3751 100644 --- a/src/sentry/integrations/utils/metrics.py +++ b/src/sentry/integrations/utils/metrics.py @@ -210,7 +210,7 @@ def record_event( if outcome == EventLifecycleOutcome.FAILURE: logger.warning(key, **log_params) elif outcome == EventLifecycleOutcome.HALTED: - logger.info(key, **log_params) + logger.warning(key, **log_params) @staticmethod def _report_flow_error(message) -> None: diff --git a/tests/sentry/integrations/utils/test_lifecycle_metrics.py b/tests/sentry/integrations/utils/test_lifecycle_metrics.py index dc2c44180ba92f..3f1948366930d2 100644 --- a/tests/sentry/integrations/utils/test_lifecycle_metrics.py +++ b/tests/sentry/integrations/utils/test_lifecycle_metrics.py @@ -90,7 +90,7 @@ def test_recording_halt( with metric_obj.capture(assume_success=False): pass self._check_metrics_call_args(mock_metrics, "halted") - mock_logger.info.assert_called_once_with( + mock_logger.warning.assert_called_once_with( "integrations.slo.halted", extra={ "integration_domain": "messaging", @@ -111,7 +111,7 @@ def test_recording_explicit_halt_with_exception( lifecycle.record_halt(ExampleException(""), extra={"even": "more"}) self._check_metrics_call_args(mock_metrics, "halted") - mock_logger.info.assert_called_once_with( + mock_logger.warning.assert_called_once_with( "integrations.slo.halted", extra={ "extra": "value", @@ -135,7 +135,7 @@ def test_recording_explicit_halt_with_str( lifecycle.record_halt("Integration went boom", extra={"even": "more"}) self._check_metrics_call_args(mock_metrics, "halted") - mock_logger.info.assert_called_once_with( + mock_logger.warning.assert_called_once_with( "integrations.slo.halted", extra={ "outcome_reason": "Integration went boom", @@ -254,7 +254,7 @@ def test_recording_halt_with_create_issue_true( self._check_metrics_call_args(mock_metrics, "halted") mock_sentry_sdk.capture_exception.assert_called_once() - mock_logger.info.assert_called_once_with( + mock_logger.warning.assert_called_once_with( "integrations.slo.halted", extra={ "extra": "value", @@ -366,7 +366,7 @@ def test_sample_log_rate_halt_with_sampling( # Metrics should always be called self._check_metrics_call_args(mock_metrics, "halted") # Logger should be called since 0.05 < 0.2 - mock_logger.info.assert_called_once() + mock_logger.warning.assert_called_once() mock_random.random.assert_called_once() @mock.patch("sentry.integrations.utils.metrics.random") @@ -406,7 +406,7 @@ def test_per_call_sample_log_rate_skips_when_below_threshold( # Metrics should always be called self._check_metrics_call_args(mock_metrics, "halted") # Logger should NOT be called since 0.15 > 0.05 (per-call rate) - mock_logger.info.assert_not_called() + mock_logger.warning.assert_not_called() mock_random.random.assert_called_once() @mock.patch("sentry.integrations.utils.metrics.random") @@ -466,7 +466,7 @@ def test_sample_log_rate_on_assume_success_false_exit( # Metrics should always be called self._check_metrics_call_args(mock_metrics, "halted") # Logger should NOT be called since 0.25 > 0.2 - mock_logger.info.assert_not_called() + mock_logger.warning.assert_not_called() mock_random.random.assert_called_once() @mock.patch("sentry.integrations.utils.metrics.logger") @@ -492,4 +492,4 @@ def test_default_sample_log_rate_is_one( pass # Will record halt # Should log since default is 1.0 - mock_logger.info.assert_called_once() + mock_logger.warning.assert_called_once()