Browse Source

chore(trace-explorer): Use custom buffer for trace explorer query (#68838)

Tony Xiao 11 months ago
parent
commit
05ff01b365
2 changed files with 8 additions and 2 deletions
  1. 2 2
      src/sentry/api/endpoints/organization_traces.py
  2. 6 0
      src/sentry/options/defaults.py

+ 2 - 2
src/sentry/api/endpoints/organization_traces.py

@@ -111,8 +111,8 @@ class OrganizationTracesEndpoint(OrganizationEventsV2EndpointBase):
                         max_timestamp = timestamp
 
             # TODO: move to use `update_snuba_params_with_timestamp`
-            time_buffer = options.get("performance.traces.transaction_query_timebuffer_days")
-            buffer = timedelta(days=time_buffer)
+            time_buffer = options.get("performance.traces.trace-explorer-buffer-hours")
+            buffer = timedelta(hours=time_buffer)
             params["start"] = min_timestamp - buffer
             params["end"] = max_timestamp + buffer
             snuba_params.start = min_timestamp - buffer

+ 6 - 0
src/sentry/options/defaults.py

@@ -1746,6 +1746,12 @@ register(
     default=False,
     flags=FLAG_AUTOMATOR_MODIFIABLE,
 )
+register(
+    "performance.traces.trace-explorer-buffer-hours",
+    type=Float,
+    default=1.0,
+    flags=FLAG_AUTOMATOR_MODIFIABLE,
+)  # hours
 
 # Dynamic Sampling system-wide options
 # Size of the sliding window used for dynamic sampling. It is defaulted to 24 hours.