Skip to content

Commit 2334867

Browse files
chore(HC): Adds logging with a low sample rate for cache misses on options (#88377)
Adds logging with a 1% sample rate to cache misses in our options store. This PR replaces #88360 for now.
1 parent 965732b commit 2334867

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/sentry/options/store.py

+8
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ def get(self, key, silent=False):
9494
if result is not None:
9595
return result
9696

97+
if random() < 0.01:
98+
# Log 1% of our cache misses for option retrieval to help triage
99+
# excessive queries against the store.
100+
logger.info(
101+
"sentry_options_store.cache_miss",
102+
extra={"key": key.name, "ttl": key.ttl, "grace": key.grace},
103+
)
104+
97105
result = self.get_store(key, silent=silent)
98106
if result is not None:
99107
return result

0 commit comments

Comments
 (0)