Skip to content

Commit 6695d58

Browse files
authored
chore(trace-explorer): Make sample rate optional for trace explorer (#69052)
This is likely the cause of there only being 1 span per trace. Let's make it optional so we can test turning it off and see how that affects results.
1 parent ce6dec0 commit 6695d58

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/sentry/api/endpoints/organization_traces.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ def get(self, request: Request, organization: Organization) -> Response:
7070

7171
def data_fn(offset: int, limit: int):
7272
with handle_query_errors():
73+
sample_rate = options.get("traces.sample-list.sample-rate")
74+
if sample_rate <= 0:
75+
sample_rate = None
7376
builder = SpansIndexedQueryBuilder(
7477
Dataset.SpansIndexed,
7578
cast(ParamsType, params),
@@ -82,7 +85,7 @@ def data_fn(offset: int, limit: int):
8285
orderby=None,
8386
limit=per_page * serialized["maxSpansPerTrace"],
8487
limitby=("trace", serialized["maxSpansPerTrace"]),
85-
sample_rate=options.get("traces.sample-list.sample-rate"),
88+
sample_rate=sample_rate,
8689
config=QueryBuilderConfig(
8790
transform_alias_to_input_format=True,
8891
),

src/sentry/options/defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2407,6 +2407,6 @@
24072407
register(
24082408
"traces.sample-list.sample-rate",
24092409
type=Float,
2410-
default=100_000.0,
2410+
default=0.0,
24112411
flags=FLAG_PRIORITIZE_DISK | FLAG_AUTOMATOR_MODIFIABLE,
24122412
)

0 commit comments

Comments
 (0)