Skip to content

[MSD benchmark] feat(upsampling) - Support upsampled error count with performance optimizations#3

Open
khaliqgant wants to merge 2 commits into
msd-benchmark-base/sentry/pr-3from
msd-benchmark/sentry/pr-3
Open

[MSD benchmark] feat(upsampling) - Support upsampled error count with performance optimizations#3
khaliqgant wants to merge 2 commits into
msd-benchmark-base/sentry/pr-3from
msd-benchmark/sentry/pr-3

Conversation

@khaliqgant

Copy link
Copy Markdown

MSD benchmark PR recreated from Martian Code Review Bench.

Source PR: ai-code-review-evaluation#3
Dataset: sentry
Original title: feat(upsampling) - Support upsampled error count with performance optimizations

Test 3

yuvmen and others added 2 commits July 25, 2025 09:48
…(#94376)

Part of the Error Upsampling project:
https://www.notion.so/sentry/Tech-Spec-Error-Up-Sampling-1e58b10e4b5d80af855cf3b992f75894?source=copy_link

Events-stats API will now check if all projects in the query are
allowlisted for upsampling, and convert the count query to a sum over
`sample_weight` in Snuba, this is done by defining a new SnQL function
`upsampled_count()`.

I noticed there are also eps() and epm() functions in use in this
endpoint. I considered (and even worked on) also supporting
swapping eps() and epm() which for correctness should probably also not
count naively and use `sample_weight`, but this
caused some complications and since they are only in use by specific
dashboard widgets and not available in discover
I decided to defer changing them until we realize it is needed.
- Add 60-second cache for upsampling eligibility checks to improve performance
- Separate upsampling eligibility check from query transformation for better optimization
- Remove unnecessary null checks in upsampled_count() function per schema requirements
- Add cache invalidation utilities for configuration management

This improves performance during high-traffic periods by avoiding repeated
expensive allowlist lookups while maintaining data consistency.
@khaliqgant khaliqgant changed the base branch from master to msd-benchmark-base/sentry/pr-3 May 15, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants