diff --git a/src/sentry/tasks/auto_ongoing_issues.py b/src/sentry/tasks/auto_ongoing_issues.py index cd8d930c2e8e0d..5410aa00cf8c6f 100644 --- a/src/sentry/tasks/auto_ongoing_issues.py +++ b/src/sentry/tasks/auto_ongoing_issues.py @@ -145,8 +145,6 @@ def get_total_count(results): id__lte=most_recent_group_first_seen_seven_days_ago.id, ) - groups_to_update_count = base_queryset._clone().count() - with sentry_sdk.start_span(description="iterate_chunked_group_ids"): for new_group_ids in chunked( RangeQuerySetWrapper( @@ -162,21 +160,11 @@ def get_total_count(results): group_ids=new_group_ids, ) - with sentry_sdk.start_span(description="get_remaining_groups") as span: - remaining_groups = groups_to_update_count - total_count - - span.set_tag("remaining_groups", remaining_groups) - metrics.incr( "sentry.tasks.schedule_auto_transition_issues_new_to_ongoing.executed", sample_rate=1.0, tags={"count": total_count}, ) - metrics.incr( - "sentry.tasks.schedule_auto_transition_issues_new_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": remaining_groups}, - ) @instrumented_task( @@ -247,8 +235,6 @@ def get_total_count(results): .filter(recent_regressed_history__lte=datetime.fromtimestamp(date_added_lte, timezone.utc)) ) - groups_to_update_count = base_queryset._clone().count() - with sentry_sdk.start_span(description="iterate_chunked_group_ids"): for group_ids_with_regressed_history in chunked( RangeQuerySetWrapper( @@ -264,21 +250,11 @@ def get_total_count(results): group_ids=group_ids_with_regressed_history, ) - with sentry_sdk.start_span(description="get_remaining_groups") as span: - remaining_groups = groups_to_update_count - total_count - - span.set_tag("remaining_groups", remaining_groups) - metrics.incr( "sentry.tasks.schedule_auto_transition_issues_regressed_to_ongoing.executed", sample_rate=1.0, tags={"count": total_count}, ) - metrics.incr( - "sentry.tasks.schedule_auto_transition_issues_regressed_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": remaining_groups}, - ) @instrumented_task( @@ -349,8 +325,6 @@ def get_total_count(results): .filter(recent_escalating_history__lte=datetime.fromtimestamp(date_added_lte, timezone.utc)) ) - groups_to_update_count = base_queryset._clone().count() - with sentry_sdk.start_span(description="iterate_chunked_group_ids"): for new_group_ids in chunked( RangeQuerySetWrapper( @@ -366,21 +340,11 @@ def get_total_count(results): group_ids=new_group_ids, ) - with sentry_sdk.start_span(description="get_remaining_groups") as span: - remaining_groups = groups_to_update_count - total_count - - span.set_tag("remaining_groups", remaining_groups) - metrics.incr( "sentry.tasks.schedule_auto_transition_issues_escalating_to_ongoing.executed", sample_rate=1.0, tags={"count": total_count}, ) - metrics.incr( - "sentry.tasks.schedule_auto_transition_issues_escalating_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": remaining_groups}, - ) @instrumented_task( diff --git a/tests/sentry/tasks/test_auto_ongoing_issues.py b/tests/sentry/tasks/test_auto_ongoing_issues.py index 8a6e6053e3335c..49812f23f1b47e 100644 --- a/tests/sentry/tasks/test_auto_ongoing_issues.py +++ b/tests/sentry/tasks/test_auto_ongoing_issues.py @@ -201,32 +201,18 @@ def test_not_all_groups_get_updated(self, mock_backend, mock_metrics_incr): sample_rate=1.0, tags={"count": 100}, ) - mock_metrics_incr.assert_any_call( - "sentry.tasks.schedule_auto_transition_issues_new_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": 10}, - ) mock_metrics_incr.assert_any_call( "sentry.tasks.schedule_auto_transition_issues_regressed_to_ongoing.executed", sample_rate=1.0, tags={"count": 0}, ) - mock_metrics_incr.assert_any_call( - "sentry.tasks.schedule_auto_transition_issues_regressed_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": 0}, - ) + mock_metrics_incr.assert_any_call( "sentry.tasks.schedule_auto_transition_issues_escalating_to_ongoing.executed", sample_rate=1.0, tags={"count": 0}, ) - mock_metrics_incr.assert_any_call( - "sentry.tasks.schedule_auto_transition_issues_escalating_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": 0}, - ) @apply_feature_flag_on_cls("organizations:escalating-issues") @@ -318,32 +304,18 @@ def test_not_all_groups_get_updated(self, mock_backend, mock_metrics_incr): sample_rate=1.0, tags={"count": 0}, ) - mock_metrics_incr.assert_any_call( - "sentry.tasks.schedule_auto_transition_issues_new_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": 0}, - ) mock_metrics_incr.assert_any_call( "sentry.tasks.schedule_auto_transition_issues_regressed_to_ongoing.executed", sample_rate=1.0, tags={"count": 100}, ) - mock_metrics_incr.assert_any_call( - "sentry.tasks.schedule_auto_transition_issues_regressed_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": 10}, - ) + mock_metrics_incr.assert_any_call( "sentry.tasks.schedule_auto_transition_issues_escalating_to_ongoing.executed", sample_rate=1.0, tags={"count": 0}, ) - mock_metrics_incr.assert_any_call( - "sentry.tasks.schedule_auto_transition_issues_escalating_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": 0}, - ) @apply_feature_flag_on_cls("organizations:escalating-issues") @@ -436,29 +408,15 @@ def test_not_all_groups_get_updated(self, mock_backend, mock_metrics_incr): sample_rate=1.0, tags={"count": 0}, ) - mock_metrics_incr.assert_any_call( - "sentry.tasks.schedule_auto_transition_issues_new_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": 0}, - ) mock_metrics_incr.assert_any_call( "sentry.tasks.schedule_auto_transition_issues_regressed_to_ongoing.executed", sample_rate=1.0, tags={"count": 0}, ) - mock_metrics_incr.assert_any_call( - "sentry.tasks.schedule_auto_transition_issues_regressed_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": 0}, - ) + mock_metrics_incr.assert_any_call( "sentry.tasks.schedule_auto_transition_issues_escalating_to_ongoing.executed", sample_rate=1.0, tags={"count": 100}, ) - mock_metrics_incr.assert_any_call( - "sentry.tasks.schedule_auto_transition_issues_escalating_to_ongoing.remaining", - sample_rate=1.0, - tags={"count": 10}, - )