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: 6 additions & 0 deletions src/sentry/options/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -2001,6 +2001,12 @@
default=1,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)
register(
"performance.traces.pagination.query-limit",
type=Int,
default=10_000,
flags=FLAG_AUTOMATOR_MODIFIABLE,
)
register(
"performance.traces.pagination.max-timeout",
type=Float,
Expand Down
3 changes: 1 addition & 2 deletions src/sentry/snuba/spans_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from sentry.utils.snuba import SnubaTSResult

logger = logging.getLogger("sentry.snuba.spans_rpc")
TRACE_QUERY_LIMIT_OVERRIDE: None | int = None


class Spans(rpc_dataset_common.RPCBase):
Expand Down Expand Up @@ -220,7 +219,7 @@ def run_trace_query(
meta=meta,
trace_id=trace_id,
# when this is None we just get the default limit
limit=TRACE_QUERY_LIMIT_OVERRIDE, # type: ignore[arg-type]
limit=options.get("performance.traces.pagination.query-limit"),
items=[
GetTraceRequest.TraceItem(
item_type=TraceItemType.TRACE_ITEM_TYPE_SPAN,
Expand Down
2 changes: 1 addition & 1 deletion tests/snuba/api/endpoints/test_organization_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ def test_simple(self) -> None:
{
"performance.traces.pagination.max-iterations": 30,
"performance.traces.pagination.max-timeout": 15,
"performance.traces.pagination.query-limit": 5,
}
)
@mock.patch("sentry.snuba.spans_rpc.TRACE_QUERY_LIMIT_OVERRIDE", 5)
def test_pagination(self) -> None:
"""Test is identical to test_simple, but with the limit override, we'll need to make multiple requests to get
all of the trace"""
Expand Down
Loading