Skip to content

Sampling by fingerprint #27884

Closed as not planned
Closed as not planned

Description

@roberttod

Problem Statement

Projects with a lot of traffic tend to be a lot more expensive to integrate with Sentry because during error conditions there will be many times more errors sent. Roughly speaking, there's a linear correlation between traffic and $ cost for Sentry errors. Of course there is sampling to reduce this cost, but then you lose critical information because errors that happen at a lower rate than the sample rate could be cut out if other errors are happening at a high frequency.

One could argue that if there are errors happening at high frequency, then they should be addressed, deleted or filtered. But in my experience that's not reasonable - frontend projects with many users will frequently get into this state and by the time some thought has been put into mitigation you may have already exhausted many wasted $$ or missed a load of new errors that were sampled out.

Why can't there be a sample rate per event fingerprint? I understand that would still incur higher costs for high traffic projects (for example, you'll need to store those fingerprints somewhere) but the cost-errorrate relationship would not be linear and you'd barely lose any functionality by applying the sampling. You could even continue counting the errors correctly but not put the full error event information into the system.

Solution Brainstorm

  • Switch in the UI for turning on sampling by error fingerprint. Select a sample rate.
  • When switched on, server will apply fingerprint logic to the error and check against a counter in a key:value store to check whether it should be sampled out.
  • (optionally) Add the timestamp to the error log without any detailed info (adding to the cost).

Activity

  1. getsentry-release commented on Aug 3, 2021

    @getsentry-release

    Routing to @getsentry/owners-ingest for triage. ⏲️

  2. BYK commented on Aug 3, 2021

    @BYK
    Member

    We have features that seem like can help with your problem:

    Not sure if you already saw these and your proposal is in addition to existing solutions or you were unable to find these resources (hence sharing them here).

  3. untitaker commented on Aug 3, 2021

    @untitaker
    Member

    Why can't there be a sample rate per event fingerprint?

    Because determining the fingerprint for a particular event depends on resolving sourcemaps and debug symbols, which is the most expensive thing we do with an event on the server. We don't want people to send us large amounts of traffic, have us process it all and pay none of the cost that it incurs. All the existing sampling and filtering you can do today is cheap to execute because they're based on data that does not need to be computed by the server first. This doesn't apply to languages like Python/Ruby, but does to JS, for example.

  4. jan-auer commented on Aug 6, 2021

    @jan-auer
    Member

    @roberttod to clarify, when you say "fingerprint" do you mean:

  5. roberttod commented on Aug 6, 2021

    @roberttod
    Author

    Thanks @BYK - I've seen these features but the spike protection is only useful for unexpected spikes, rather than long running high frequency errors and the filtering needs manual intervention for each error type and it'll stop reporting an error that might still need to be addressed.

  6. 6 remaining items

  7. removed their assignment
    on Jan 18, 2023
  8. olksdr commented on Jun 9, 2025

    @olksdr
    Contributor

    closing as won't do.

  9. locked and limited conversation to collaborators on Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions