From 83c64c9b13bc58126f06b331b8fbedb3d577704a Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Tue, 25 Nov 2025 16:42:16 -0500 Subject: [PATCH 1/3] chore(logs): Remove ourlogs-high-fidelity feature flag backend This feature has been rolled out so we can delete the flag now. Depends on #104016 --- src/sentry/api/bases/organization_events.py | 6 ------ src/sentry/features/temporary.py | 2 -- .../endpoints/test_organization_events_ourlogs.py | 14 +++----------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/sentry/api/bases/organization_events.py b/src/sentry/api/bases/organization_events.py index 7746280ab6ca0f..f3f79669f9e686 100644 --- a/src/sentry/api/bases/organization_events.py +++ b/src/sentry/api/bases/organization_events.py @@ -163,12 +163,6 @@ def get_snuba_params( sampling_mode = cast(SAMPLING_MODES, sampling_mode.upper()) sentry_sdk.set_tag("sampling_mode", sampling_mode) - # kill switch: disable the highest accuracy flex time strategy to avoid hammering snuba - if sampling_mode == "HIGHEST_ACCURACY_FLEX_TIME" and not features.has( - "organizations:ourlogs-high-fidelity", organization, actor=request.user - ): - raise ParseError(f"sampling mode: {sampling_mode} is not supported") - if quantize_date_params: filter_params = self.quantize_date_params(request, filter_params) params = SnubaParams( diff --git a/src/sentry/features/temporary.py b/src/sentry/features/temporary.py index cfe8435a868d82..25df6fcf6a6ce3 100644 --- a/src/sentry/features/temporary.py +++ b/src/sentry/features/temporary.py @@ -585,8 +585,6 @@ def register_temporary_features(manager: FeatureManager) -> None: manager.add("organizations:ourlogs-tags-ui", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) # Enable service hooks outbox manager.add("organizations:service-hooks-outbox", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False) - # Enable UI for log high fidelity queries - manager.add("organizations:ourlogs-high-fidelity", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) # Enable alerting on trace metrics manager.add("organizations:tracemetrics-alerts", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) # Enable trace metrics in dashboards UI diff --git a/tests/snuba/api/endpoints/test_organization_events_ourlogs.py b/tests/snuba/api/endpoints/test_organization_events_ourlogs.py index 79b043412b84f3..63e3def8fac371 100644 --- a/tests/snuba/api/endpoints/test_organization_events_ourlogs.py +++ b/tests/snuba/api/endpoints/test_organization_events_ourlogs.py @@ -562,7 +562,6 @@ def test_high_accuracy_flex_time_filter_trace(self): "dataset": self.dataset, "sampling": "HIGHEST_ACCURACY_FLEX_TIME", }, - features={"organizations:ourlogs-high-fidelity": True}, ) assert response.status_code == 200, response.content @@ -601,7 +600,6 @@ def test_high_accuracy_flex_time_order_by_timestamp(self): "dataset": self.dataset, "sampling": "HIGHEST_ACCURACY_FLEX_TIME", }, - features={"organizations:ourlogs-high-fidelity": True}, ) assert response.status_code == 200, response.content @@ -616,7 +614,6 @@ def test_high_accuracy_flex_time_empty_page_no_next(self): "dataset": self.dataset, "sampling": "HIGHEST_ACCURACY_FLEX_TIME", }, - features={"organizations:ourlogs-high-fidelity": True}, ) assert response.status_code == 200, response.content @@ -647,7 +644,6 @@ def test_high_accuracy_flex_time_partial_page_no_next(self): "sampling": "HIGHEST_ACCURACY_FLEX_TIME", "per_page": 10, }, - features={"organizations:ourlogs-high-fidelity": True}, ) assert response.status_code == 200, response.content @@ -680,7 +676,6 @@ def test_high_accuracy_flex_time_full_page_no_next(self): "sampling": "HIGHEST_ACCURACY_FLEX_TIME", "per_page": 5, }, - features={"organizations:ourlogs-high-fidelity": True}, ) assert response.status_code == 200, response.content @@ -715,7 +710,7 @@ def test_high_accuracy_flex_time_full_page_with_next(self): "per_page": 5, } - response = self.do_request(request, features={"organizations:ourlogs-high-fidelity": True}) + response = self.do_request(request) assert response.status_code == 200, response.content assert [row["message"] for row in response.data["data"]] == [ @@ -731,7 +726,6 @@ def test_high_accuracy_flex_time_full_page_with_next(self): response = self.do_request( {**request, "cursor": links["next"]["cursor"]}, - features={"organizations:ourlogs-high-fidelity": True}, ) assert response.status_code == 200, response.content @@ -801,7 +795,7 @@ def test_high_accuracy_flex_time_partial_page_with_next(self): "end": hour_4.isoformat(), } - response = self.do_request(request, features={"organizations:ourlogs-high-fidelity": True}) + response = self.do_request(request) assert response.status_code == 200, response.content assert [row["message"] for row in response.data["data"]] == ["log 1"] @@ -815,7 +809,6 @@ def test_high_accuracy_flex_time_partial_page_with_next(self): response = self.do_request( {**request, "cursor": links["next"]["cursor"]}, - features={"organizations:ourlogs-high-fidelity": True}, ) assert response.status_code == 200, response.content @@ -878,7 +871,7 @@ def test_high_accuracy_flex_time_empty_page_with_next(self): "end": hour_4.isoformat(), } - response = self.do_request(request, features={"organizations:ourlogs-high-fidelity": True}) + response = self.do_request(request) assert response.status_code == 200, response.content assert response.data["data"] == [] @@ -892,7 +885,6 @@ def test_high_accuracy_flex_time_empty_page_with_next(self): response = self.do_request( {**request, "cursor": links["next"]["cursor"]}, - features={"organizations:ourlogs-high-fidelity": True}, ) assert response.status_code == 200, response.content From 81188a9da9c95c89d3b7a650509dbe994dc39f62 Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Tue, 25 Nov 2025 16:47:15 -0500 Subject: [PATCH 2/3] remove unneeded test --- .../endpoints/test_organization_events_ourlogs.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tests/snuba/api/endpoints/test_organization_events_ourlogs.py b/tests/snuba/api/endpoints/test_organization_events_ourlogs.py index 63e3def8fac371..e660194d8b9882 100644 --- a/tests/snuba/api/endpoints/test_organization_events_ourlogs.py +++ b/tests/snuba/api/endpoints/test_organization_events_ourlogs.py @@ -897,19 +897,6 @@ def test_high_accuracy_flex_time_empty_page_with_next(self): assert links["previous"]["results"] == "false" assert links["next"]["results"] == "true" - def test_high_accuracy_flex_time_without_feature_flag(self): - request = { - "field": ["timestamp", "message"], - "orderby": "-timestamp", - "project": self.project.id, - "dataset": self.dataset, - "sampling": "HIGHEST_ACCURACY_FLEX_TIME", - "per_page": 5, - } - - response = self.do_request(request) - assert response.status_code == 400 - def test_bytes_scanned(self): self.store_ourlogs([self.create_ourlog({"body": "log"}, timestamp=self.ten_mins_ago)]) From ca080e8c16c9256f6702bfff6cb937de63229abf Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Tue, 25 Nov 2025 17:11:33 -0500 Subject: [PATCH 3/3] put back feature flag --- src/sentry/features/temporary.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sentry/features/temporary.py b/src/sentry/features/temporary.py index 25df6fcf6a6ce3..cfe8435a868d82 100644 --- a/src/sentry/features/temporary.py +++ b/src/sentry/features/temporary.py @@ -585,6 +585,8 @@ def register_temporary_features(manager: FeatureManager) -> None: manager.add("organizations:ourlogs-tags-ui", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) # Enable service hooks outbox manager.add("organizations:service-hooks-outbox", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False) + # Enable UI for log high fidelity queries + manager.add("organizations:ourlogs-high-fidelity", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) # Enable alerting on trace metrics manager.add("organizations:tracemetrics-alerts", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) # Enable trace metrics in dashboards UI