|
@@ -1759,6 +1759,32 @@ class PostProcessGroupErrorTest(
|
|
|
)
|
|
|
return cache_key
|
|
|
|
|
|
+ @with_feature("organizations:escalating-metrics-backend")
|
|
|
+ @patch("sentry.sentry_metrics.client.generic_metrics_backend.counter")
|
|
|
+ def test_generic_metrics_backend_counter(self, generic_metrics_backend_mock):
|
|
|
+ min_ago = iso_format(before_now(minutes=1))
|
|
|
+ event = self.create_event(
|
|
|
+ data={
|
|
|
+ "exception": {
|
|
|
+ "values": [
|
|
|
+ {
|
|
|
+ "type": "ZeroDivisionError",
|
|
|
+ "stacktrace": {"frames": [{"function": f} for f in ["a", "b"]]},
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "timestamp": min_ago,
|
|
|
+ "start_timestamp": min_ago,
|
|
|
+ "contexts": {"trace": {"trace_id": "b" * 32, "span_id": "c" * 16, "op": ""}},
|
|
|
+ },
|
|
|
+ project_id=self.project.id,
|
|
|
+ )
|
|
|
+ self.call_post_process_group(
|
|
|
+ is_new=True, is_regression=False, is_new_group_environment=True, event=event
|
|
|
+ )
|
|
|
+
|
|
|
+ assert generic_metrics_backend_mock.call_count == 1
|
|
|
+
|
|
|
|
|
|
@region_silo_test
|
|
|
class PostProcessGroupPerformanceTest(
|
|
@@ -1804,6 +1830,7 @@ class PostProcessGroupPerformanceTest(
|
|
|
)
|
|
|
return cache_key
|
|
|
|
|
|
+ @patch("sentry.sentry_metrics.client.generic_metrics_backend.counter")
|
|
|
@patch("sentry.tasks.post_process.run_post_process_job")
|
|
|
@patch("sentry.rules.processor.RuleProcessor")
|
|
|
@patch("sentry.signals.transaction_processed.send_robust")
|
|
@@ -1814,6 +1841,7 @@ class PostProcessGroupPerformanceTest(
|
|
|
transaction_processed_signal_mock,
|
|
|
mock_processor,
|
|
|
run_post_process_job_mock,
|
|
|
+ generic_metrics_backend_mock,
|
|
|
):
|
|
|
min_ago = before_now(minutes=1).replace(tzinfo=timezone.utc)
|
|
|
event = self.store_transaction(
|
|
@@ -1838,6 +1866,7 @@ class PostProcessGroupPerformanceTest(
|
|
|
assert event_processed_signal_mock.call_count == 0
|
|
|
assert mock_processor.call_count == 0
|
|
|
assert run_post_process_job_mock.call_count == 0
|
|
|
+ assert generic_metrics_backend_mock.call_count == 0
|
|
|
|
|
|
@patch("sentry.tasks.post_process.handle_owner_assignment")
|
|
|
@patch("sentry.tasks.post_process.handle_auto_assignment")
|