Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/sentry/tagstore/snuba/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,13 @@ def get_tag_keys_for_projects(
organization = Organization.objects.get_from_cache(id=organization_id)
if features.has("organizations:tag-key-sample-n", organization):
optimize_kwargs["sample"] = options.get("visibility.tag-key-sample-size")

# If we are fetching less than max_unsampled_projects, then disable
# the sampling that turbo enables so that we get more accurate results.
# We only want sampling when we have a large number of projects, so
# that we don't cause performance issues for Snuba.
# We also see issues with long timeranges in large projects,
# So only disable sampling if the timerange is short enough.
if len(projects) <= max_unsampled_projects and end - start <= timedelta(days=14):
elif len(projects) <= max_unsampled_projects and end - start <= timedelta(days=14):
optimize_kwargs["sample"] = 1

# Replays doesn't support sampling.
Expand Down
Loading