Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/sentry/api/bases/organization_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
27 changes: 3 additions & 24 deletions tests/snuba/api/endpoints/test_organization_events_ourlogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"]] == [
Expand All @@ -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
Expand Down Expand Up @@ -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"]
Expand All @@ -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
Expand Down Expand Up @@ -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"] == []
Expand All @@ -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
Expand All @@ -905,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)])

Expand Down
Loading