Skip to content

Automated Test: error-upsampling-race-condition #318

Closed
wants to merge 2 commits into from

Commits on Jul 25, 2025

  1. feat(upsampling) - Support upsampled error count in events-stats API …

    …(#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.
    Yuval Mandelboum authored and bobharper208 committed Jul 25, 2025
    Configuration menu
    Copy the full SHA
    4cb317c View commit details
    Browse the repository at this point in the history
  2. feat(upsampling): Add performance optimizations with caching

    - 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.
    bobharper208 committed Jul 25, 2025
    Configuration menu
    Copy the full SHA
    6ad6fe3 View commit details
    Browse the repository at this point in the history