From 05d0a94cbd3542f56b7c7f1fb1f818aa99665825 Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Tue, 16 Apr 2024 17:48:44 -0400 Subject: [PATCH 1/2] chore(trace-explorer): Make sample rate optional for trace explorer 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. --- src/sentry/api/endpoints/organization_traces.py | 3 +++ src/sentry/options/defaults.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sentry/api/endpoints/organization_traces.py b/src/sentry/api/endpoints/organization_traces.py index dedf6cc0049e90..adc81add62237c 100644 --- a/src/sentry/api/endpoints/organization_traces.py +++ b/src/sentry/api/endpoints/organization_traces.py @@ -57,6 +57,9 @@ def get(self, request: Request, organization: Organization) -> Response: def data_fn(offset: int, limit: int): with handle_query_errors(): + sample_rate = options.get("traces.sample-list.sample-rate") + if sample_rate <= 0: + sample_rate = None builder = SpansIndexedQueryBuilder( Dataset.SpansIndexed, cast(ParamsType, params), diff --git a/src/sentry/options/defaults.py b/src/sentry/options/defaults.py index fed4ea22171725..55c371fa9f89a6 100644 --- a/src/sentry/options/defaults.py +++ b/src/sentry/options/defaults.py @@ -2413,6 +2413,6 @@ register( "traces.sample-list.sample-rate", type=Float, - default=100_000.0, + default=0.0, flags=FLAG_PRIORITIZE_DISK | FLAG_AUTOMATOR_MODIFIABLE, ) From 3a216ef53215b7b404fb0cb7e389bbd12c450690 Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Tue, 16 Apr 2024 19:19:58 -0400 Subject: [PATCH 2/2] fix typo --- src/sentry/api/endpoints/organization_traces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/api/endpoints/organization_traces.py b/src/sentry/api/endpoints/organization_traces.py index adc81add62237c..ffd44ca8717440 100644 --- a/src/sentry/api/endpoints/organization_traces.py +++ b/src/sentry/api/endpoints/organization_traces.py @@ -72,7 +72,7 @@ def data_fn(offset: int, limit: int): orderby=None, limit=per_page * serialized["maxSpansPerTrace"], limitby=("trace", serialized["maxSpansPerTrace"]), - sample_rate=options.get("traces.sample-list.sample-rate"), + sample_rate=sample_rate, config=QueryBuilderConfig( transform_alias_to_input_format=True, ),