Skip to content

Commit 3d45d32

Browse files
authored
fix(dynamic-sampling): lower query granularity for project rebalancing (#97757)
1 parent 48b7d01 commit 3d45d32

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/sentry/dynamic_sampling/tasks/boost_low_volume_projects.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,10 @@ def query_project_counts_by_org(
355355
if query_interval > timedelta(days=1):
356356
granularity = Granularity(24 * 3600)
357357
else:
358-
granularity = Granularity(3600)
358+
if options.get("dynamic-sampling.query-granularity-60s", None):
359+
granularity = Granularity(60)
360+
else:
361+
granularity = Granularity(3600)
359362

360363
org_ids = list(org_ids)
361364
project_ids = list(

src/sentry/options/defaults.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3472,3 +3472,11 @@
34723472

34733473
# Whether the new objectstore implementation is being used for attachments
34743474
register("objectstore.enable_for.attachments", default=0.0, flags=FLAG_AUTOMATOR_MODIFIABLE)
3475+
3476+
# Whether to use 60s granularity for the dynamic sampling query
3477+
register(
3478+
"dynamic-sampling.query-granularity-60s",
3479+
type=Bool,
3480+
default=False,
3481+
flags=FLAG_AUTOMATOR_MODIFIABLE,
3482+
)

0 commit comments

Comments
 (0)