Description
Problem Statement
If a critical infrastructure component goes down (say a DB cluster becomes unreachable due to network issues), an application will start generating a lot of errors.
When this happens, small organizations which do not have staff available 24/7 can incur in the very unpleasant situation in which this repeated error happens during a holiday or weekend while the staff is off and consumes not only the entire error quota, but also the on-demand spend.
Solution Brainstorm
To avoid this, it would be really great if there was a way we could tell sentry to discard the same occurrence of the same error if there's more occurrences of X times within X hours. For example, I wouldn't want to receive more than 200 instances of an error within 24 hours. By the time I wake up I will find out and intervene.
Activity
getsantry commentedon Mar 31, 2023
Assigning to @getsentry/support for routing, due by Friday, March 31st at 5:00 pm (sfo). ⏲️
getsantry commentedon Mar 31, 2023
Routing to @getsentry/telemetry-experience for triage, due by Tuesday, April 4th at 17:00 (vie). ⏲️
getsantry commentedon Apr 3, 2023
Routing to @getsentry/enterprise for triage, due by Tuesday, April 4th at 5:00 pm (sfo). ⏲️
matejminar commentedon Apr 3, 2023
Hey Enterprise team, can you please take a look? I would expect spike protection to kick in / solve this.
nemesifier commentedon Apr 3, 2023
AFAIK spike protection will work only the first few hours but afterwards as the average of the collected errors increases it will allow the errors to be collected.
souredoutlook commentedon Apr 3, 2023
@nemesisdesign we're working on rolling out Spike Protection 2.0 #44155 @Dhrumil-Sentry can add some additional details
leedongwei commentedon Apr 4, 2023
@nemesisdesign we have a new heuristic for Spike Protection that raises the limit less. Here's an example of its behaviour during an extended incident.

This should help to put an upper-bound on the consumption of your quota and on-demand during a long incident. This new Spike Protection will be rolled out next week and it should solve your issue.
On the feature request:
We are highly unlikely to build a tool to do exactly this. To identify an incoming event as the 201th instance of an error, Sentry would need to unpack, process, fingerprint and cross-reference it - which is essentially all the computationally expensive work. The final step of storing and querying is cheap.
We would not be sustainable as a business if we do not count usage for the expensive parts of the pipeline.
The best way to protect your quota/on-demand during an incident is through client-side sampling, spike protection and spend allocation - which happens much earlier in the pipeline.
github-actions commentedon Apr 26, 2023
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it
Status: BacklogorStatus: In Progress, I will leave it alone ... forever!"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀