You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/product/accounts/quotas/manage-event-stream-guide.mdx
+54Lines changed: 54 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,60 @@ To review the error events dropped because of spike protection, go to the "Usage
111
111
112
112
Events will not be dropped during any minute in which you don't send more than the hourly limit that Sentry has calculated for you. After 24 hours without any dropped events, spike protection becomes "inactive" again. This means that it is no longer dropping events, but _it does not mean the system has stopped paying attention._ The next time events are dropped, spike protection will be "reactivated".
113
113
114
+
### New Heuristic Changes
115
+
116
+
<Includename="limited-avail-note.mdx" />
117
+
118
+
Spike protection is enabled for every project by default, and when it's enabled, Sentry continually monitors for spikes. You can confirm that it's enabled inΒ **Settings > Projects > _Select Project_ > General Settings**.
119
+
120
+
The way our spike protection algorithm essentially works is by using a weighted average of your events over the past 168 hours (past 7 days), applying a multiplier to that number, comparing this final number against a floor bound that is determined using your quota, and setting that as your spike limit.
121
+
122
+
### Spike Protection Inputs
123
+
124
+
- Number of projects
125
+
- Quota (per event type)
126
+
- Events in the past 7 days
127
+
128
+
### Floor Bound Calculation
129
+
130
+
To break it down even further, the first step of this algorithm identifies a floor bound that is calculated using your quota. This bound takes the max of either 500 events or (3 \* your quota)/(720 \* number of projects) - the latter number represents your project using up 3 times your overall quota in 30 days if events are continually ingested at this hourly rate, thus flagging for a potential spike.
131
+
132
+
### Spike Limit Calculation
133
+
134
+
The next step uses hourly data from the past 7 days to calculate spike limit projections for the next 7 days. This data is used to calculate weighted averages, which takes into account weekly and hourly seasonality. For example, the weighted average calculated for Monday at 3 pm is more heavily influenced by data points on Monday or hours around 3 pm. This weighted average is then multiplied by a multiplier that is 5 times the overall standard deviation of the past week - this multiplier is bounded between 3 and 6.
135
+
136
+
### Setting the Final Limit
137
+
138
+
The final spike limit for each hour is set to the max of the floor bound or the calculated limit. This is done for a multitude of reasons - firstly, using the floor bound protects smaller or new projects. New projects that do not have a weekβs worth of data to use to calibrate spike limits can use the floor, an adaptation of the organizationβs quota, to approximate appropriate limits. Additionally, the floor can be used to minimize false positives in smaller/new projects such that spikes arenβt flagged incorrectly.
139
+
140
+
Additionally, at the onset of a spike, spike limits are recalculated in real time throughout the duration of the spike. While this is done to adjust for the increasing volume of incoming events, the limit grows at a steady rate such that quota is protected and not blown through. An example of how our heuristic works during a spike is shown below.
0 commit comments