Skip to content

chore(grouping): remove grouphash cache expiry options#109677

Merged
cvxluo merged 1 commit intomasterfrom
cvxluo/snmzytolqqrx
Mar 2, 2026
Merged

chore(grouping): remove grouphash cache expiry options#109677
cvxluo merged 1 commit intomasterfrom
cvxluo/snmzytolqqrx

Conversation

@cvxluo
Copy link
Contributor

@cvxluo cvxluo commented Mar 2, 2026

The cache expiry values were experimentally verified in #108274 to not need tuning (1, 2, and 5 minute TTLs all had identical hit rates). Hardcode the 60s TTL directly and remove the options.

@cvxluo cvxluo force-pushed the cvxluo/snmzytolqqrx branch from 50f2e4d to e7418ad Compare March 2, 2026 17:58
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 2, 2026
@cvxluo cvxluo force-pushed the cvxluo/snmzytolqqrx branch from e7418ad to 64b6496 Compare March 2, 2026 18:02
@cvxluo
Copy link
Contributor Author

cvxluo commented Mar 2, 2026

@lobsterkatie lmk if this makes sense

@cvxluo cvxluo marked this pull request as ready for review March 2, 2026 18:10
@cvxluo cvxluo requested a review from a team as a code owner March 2, 2026 18:10
Copy link
Member

@shashjar shashjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but would wait on @lobsterkatie's confirmation

Copy link
Member

@lobsterkatie lobsterkatie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable change.

from sentry.utils.metrics import MutableTags
from sentry.utils.tag_normalization import normalized_sdk_tag_from_event

GROUPHASH_CACHE_EXPIRY_SECONDS = 60
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GROUPHASH_CACHE_EXPIRY_SECONDS = 60
# How long we cache both the existence of secondary grouphashes and grouphashes themselves. We use a
# minute because experimentation showed that anything more than that didn't improve hit rates.
GROUPHASH_CACHE_EXPIRY_SECONDS = 60

project = self.project
get_cache_key = get_grouphash_object_cache_key
cache_expiry_seconds = options.get("grouping.ingest_grouphash_existence_cache_expiry")
cache_expiry_seconds = 60
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to use the constant in these tests, too?

The cache expiry values were experimentally verified in #108274 to not need tuning (1, 2, and 5 minute TTLs all had identical hit rates). Hardcode the 60s TTL directly and remove the options.

Co-authored-by: Claude <noreply@anthropic.com>
@cvxluo cvxluo force-pushed the cvxluo/snmzytolqqrx branch from 1b9b07b to 9229134 Compare March 2, 2026 18:57
@cvxluo cvxluo removed request for a team March 2, 2026 18:57
@cvxluo cvxluo merged commit 140ebdd into master Mar 2, 2026
76 checks passed
@cvxluo cvxluo deleted the cvxluo/snmzytolqqrx branch March 2, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants