Skip to content

Commit 9401b10

Browse files
Revert "feat(spans): Indexed spans for aggregate span waterfall (#69016)"
This reverts commit 5e2cffe. Co-authored-by: shruthilayaj <63818634+shruthilayaj@users.noreply.github.com>
1 parent bc5ccf8 commit 9401b10

File tree

2 files changed

+154
-240
lines changed

2 files changed

+154
-240
lines changed

src/sentry/api/endpoints/organization_spans_aggregation.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import hashlib
22
from collections import defaultdict, namedtuple
33
from collections.abc import Mapping
4-
from datetime import datetime, timezone
4+
from datetime import datetime
55
from typing import Any, Optional, TypedDict
66

77
import sentry_sdk
@@ -22,7 +22,6 @@
2222
from sentry.utils.snuba import raw_snql_query
2323

2424
ALLOWED_BACKENDS = ["indexedSpans", "nodestore"]
25-
CUTOVER_DATE = datetime(2024, 3, 22, tzinfo=timezone.utc)
2625

2726
EventSpan = namedtuple(
2827
"EventSpan",
@@ -337,29 +336,31 @@ class OrganizationSpansAggregationEndpoint(OrganizationEventsEndpointBase):
337336
}
338337

339338
def get(self, request: Request, organization: Organization) -> Response:
340-
if not features.has("organizations:spans-first-ui", organization, actor=request.user):
339+
if not features.has(
340+
"organizations:starfish-aggregate-span-waterfall", organization, actor=request.user
341+
):
341342
return Response(status=404)
342343

343344
try:
344345
params = self.get_snuba_params(request, organization)
345346
except NoProjects:
346347
return Response(status=404)
347348

348-
start = params["start"]
349-
if start and start < CUTOVER_DATE:
350-
backend = "nodestore"
351-
else:
352-
backend = "indexedSpans"
353-
354349
transaction = request.query_params.get("transaction", None)
355350
http_method = request.query_params.get("http.method", None)
356351
if transaction is None:
357352
return Response(
358353
status=status.HTTP_400_BAD_REQUEST, data={"details": "Transaction not provided"}
359354
)
360355

356+
backend = request.query_params.get("backend", "nodestore")
361357
sentry_sdk.set_tag("aggregate_spans.backend", backend)
362358

359+
if backend not in ALLOWED_BACKENDS:
360+
return Response(
361+
status=status.HTTP_400_BAD_REQUEST, data={"details": "Backend not supported"}
362+
)
363+
363364
query = f"transaction:{transaction}"
364365
if http_method is not None:
365366
query += f" transaction.method:{http_method}"

0 commit comments

Comments
 (0)