diff --git a/requirements-base.txt b/requirements-base.txt index 0305e0c13cbfe1..e13ed4b3e6f858 100644 --- a/requirements-base.txt +++ b/requirements-base.txt @@ -68,7 +68,7 @@ rfc3986-validator>=0.1.1 sentry-arroyo>=2.21.0 sentry-kafka-schemas>=1.2.0 sentry-ophio>=1.1.3 -sentry-protos==0.1.72 +sentry-protos==0.1.74 sentry-redis-tools>=0.5.0 sentry-relay>=0.9.8 sentry-sdk[http2]>=2.25.1 diff --git a/requirements-dev-frozen.txt b/requirements-dev-frozen.txt index 2e58ab5cc9d667..8cc5d7e468fe89 100644 --- a/requirements-dev-frozen.txt +++ b/requirements-dev-frozen.txt @@ -189,7 +189,7 @@ sentry-forked-djangorestframework-stubs==3.15.3.post1 sentry-forked-email-reply-parser==0.5.12.post1 sentry-kafka-schemas==1.2.0 sentry-ophio==1.1.3 -sentry-protos==0.1.72 +sentry-protos==0.1.74 sentry-redis-tools==0.5.0 sentry-relay==0.9.8 sentry-sdk==2.27.0 diff --git a/requirements-frozen.txt b/requirements-frozen.txt index 1a37bb36f16e7e..f84ef2c5a444f0 100644 --- a/requirements-frozen.txt +++ b/requirements-frozen.txt @@ -127,7 +127,7 @@ sentry-arroyo==2.21.0 sentry-forked-email-reply-parser==0.5.12.post1 sentry-kafka-schemas==1.2.0 sentry-ophio==1.1.3 -sentry-protos==0.1.72 +sentry-protos==0.1.74 sentry-redis-tools==0.5.0 sentry-relay==0.9.8 sentry-sdk==2.27.0 diff --git a/src/sentry/search/eap/constants.py b/src/sentry/search/eap/constants.py index d1079247a828a2..b94af5eb467dff 100644 --- a/src/sentry/search/eap/constants.py +++ b/src/sentry/search/eap/constants.py @@ -162,4 +162,5 @@ "BEST_EFFORT": DownsampledStorageConfig.MODE_BEST_EFFORT, "PREFLIGHT": DownsampledStorageConfig.MODE_PREFLIGHT, "NORMAL": DownsampledStorageConfig.MODE_NORMAL, + "HIGHEST_ACCURACY": DownsampledStorageConfig.MODE_HIGHEST_ACCURACY, } diff --git a/src/sentry/search/eap/utils.py b/src/sentry/search/eap/utils.py index dec734e83240b7..42b0b47e16b0b4 100644 --- a/src/sentry/search/eap/utils.py +++ b/src/sentry/search/eap/utils.py @@ -102,7 +102,7 @@ def transform_column_to_expression(column: Column) -> Expression: def validate_sampling(sampling_mode: SAMPLING_MODES | None) -> DownsampledStorageConfig: if sampling_mode is None: - return DownsampledStorageConfig(mode=DownsampledStorageConfig.MODE_UNSPECIFIED) + return DownsampledStorageConfig(mode=DownsampledStorageConfig.MODE_HIGHEST_ACCURACY) if sampling_mode not in SAMPLING_MODE_MAP: raise InvalidSearchQuery(f"sampling mode: {sampling_mode} is not supported") else: diff --git a/src/sentry/search/events/types.py b/src/sentry/search/events/types.py index 11099151324dcd..a190000f87fb50 100644 --- a/src/sentry/search/events/types.py +++ b/src/sentry/search/events/types.py @@ -81,7 +81,7 @@ class EventsResponse(TypedDict): meta: EventsMeta -SAMPLING_MODES = Literal["BEST_EFFORT", "PREFLIGHT", "NORMAL"] +SAMPLING_MODES = Literal["BEST_EFFORT", "PREFLIGHT", "NORMAL", "HIGHEST_ACCURACY"] @dataclass diff --git a/tests/snuba/api/endpoints/test_organization_events_stats_span_indexed.py b/tests/snuba/api/endpoints/test_organization_events_stats_span_indexed.py index df346a487fc600..55c45cf523a18c 100644 --- a/tests/snuba/api/endpoints/test_organization_events_stats_span_indexed.py +++ b/tests/snuba/api/endpoints/test_organization_events_stats_span_indexed.py @@ -2017,3 +2017,32 @@ def test_downsampling_can_go_to_higher_accuracy_tier(self): ) assert response.data["meta"]["dataScanned"] == "partial" + + def test_request_without_sampling_mode_defaults_to_highest_accuracy(self): + response = self._do_request( + data={ + "start": self.day_ago, + "end": self.day_ago + timedelta(minutes=3), + "interval": "1m", + "yAxis": "count()", + "project": self.project.id, + "dataset": self.dataset, + }, + ) + + assert response.data["meta"]["dataScanned"] == "full" + + def test_request_to_highest_accuracy_mode(self): + response = self._do_request( + data={ + "start": self.day_ago, + "end": self.day_ago + timedelta(minutes=3), + "interval": "1m", + "yAxis": "count()", + "project": self.project.id, + "dataset": self.dataset, + "sampling": "HIGHEST_ACCURACY", + }, + ) + + assert response.data["meta"]["dataScanned"] == "full"