Skip to content

Commit 2490aff

Browse files
wmakevanh
authored andcommitted
fix(tagstore): Allow flag to overwrite logic (#81062)
- The existing small # of projects & short date range should not overwrite the feature flag that samples, since the numeric sample rate should still work fine for smaller orgs
1 parent b0eb1b7 commit 2490aff

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/sentry/tagstore/snuba/backend.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,14 +442,13 @@ def get_tag_keys_for_projects(
442442
organization = Organization.objects.get_from_cache(id=organization_id)
443443
if features.has("organizations:tag-key-sample-n", organization):
444444
optimize_kwargs["sample"] = options.get("visibility.tag-key-sample-size")
445-
446445
# If we are fetching less than max_unsampled_projects, then disable
447446
# the sampling that turbo enables so that we get more accurate results.
448447
# We only want sampling when we have a large number of projects, so
449448
# that we don't cause performance issues for Snuba.
450449
# We also see issues with long timeranges in large projects,
451450
# So only disable sampling if the timerange is short enough.
452-
if len(projects) <= max_unsampled_projects and end - start <= timedelta(days=14):
451+
elif len(projects) <= max_unsampled_projects and end - start <= timedelta(days=14):
453452
optimize_kwargs["sample"] = 1
454453

455454
# Replays doesn't support sampling.

0 commit comments

Comments
 (0)