Skip to content

Commit 2a5a427

Browse files
Add Liza's new spike protection docs [merge after feature launch] (#6591)
* updates to quota managment page * Update src/docs/product/accounts/quotas/check-your-quota-usage.mdx * Update src/docs/product/accounts/quotas/inbound-data-filters.mdx * Update src/docs/product/accounts/quotas/spike-protection-for-errors.mdx * Update src/docs/product/accounts/quotas/adjusting-quotas.mdx * Update src/docs/product/accounts/quotas/rate-limiting.mdx * Update src/docs/product/accounts/quotas/review-event-repetition.mdx * Update src/docs/product/accounts/quotas/sdk-sample-rate-filtering-configuration.mdx * Update src/docs/product/accounts/quotas/inbound-data-filters.mdx * Update src/docs/product/accounts/quotas/inbound-data-filters.mdx * Update src/docs/product/accounts/quotas/adjusting-quotas.mdx * Update src/docs/product/accounts/quotas/check-your-quota-usage.mdx * Update src/docs/product/accounts/quotas/inbound-data-filters.mdx * Update src/docs/product/accounts/quotas/rate-limiting.mdx * Update src/docs/product/accounts/quotas/review-event-repetition.mdx * Update src/docs/product/accounts/quotas/sdk-sample-rate-filtering-configuration.mdx * Update src/docs/product/accounts/quotas/spike-protection-for-errors.mdx * adding new files * remove empty files * restore deleted content * remove other empty files * fix spike protection section * fix sidebar order * fix phrasing * fix link, add new screenshot * add notifications info for spike protection * tweak wording * try adding explicit heading anchors * add new bullet, fix links --------- Co-authored-by: lizokm <lizka920@gmail.com> Co-authored-by: Liza Mock <liza.mock@sentry.io>
1 parent 82e4c3e commit 2a5a427

10 files changed

+124
-134
lines changed

src/docs/product/accounts/quotas/index.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Quota Management"
3-
sidebar_order: 50
3+
sidebar_order: 70
44
redirect_from:
55
- /learn/quotas/
66
- /product/quotas/
@@ -17,7 +17,8 @@ You can also download a project breakdown report in the "Usage History" tab of *
1717

1818
Sentry's flexibility means you can exercise fine-grained control over which events and attachments count toward your quota. This page provides you with high-level information about strategies for managing your quota, but you can get more detailed information in:
1919

20-
- [Spend Allocation](./spend-allocation/)
20+
- [Spike Protection](/product/accounts/quotas/spike-protection/)
21+
- [Spend Allocation](/product/accounts/quotas/spend-allocation/)
2122
- [Manage Your Error Quota](/product/accounts/quotas/manage-event-stream-guide/)
2223
- [Manage Your Transaction Quota](/product/accounts/quotas/manage-transaction-quota/)
2324
- [Manage Your Replay Quota](/product/accounts/quotas/manage-replay-quota/)
@@ -33,8 +34,8 @@ The first 6 actions in the list can all be done in [sentry.io](https://sentry.io
3334

3435
| Action | Errors | Transactions | Attachments |
3536
| ------ | ------ | ------------ | ----------- |
36-
| [Check your spike protection is enabled](#spike-protection) | &check; | | |
37-
| [Set a Spend Allocation budget](#spend-allocation) | &check; | &check; | &check; |
37+
| [Ensure spike protection is enabled](#spike-protection) | &check; | &check; | &check; |
38+
| [Set a spend allocation budget](#spend-allocation) | &check; | &check; | &check; |
3839
| [Adjust your quota](#increasing-quotas) | &check; | &check; | &check; |
3940
| [Rate limit your events or attachments](#limiting-events) | &check; | | &check; |
4041
| [Review repeated events](#4-event-repetition) | &check; | | |
@@ -60,11 +61,13 @@ This list is ordered from easiest or least time-consuming, to most challenging o
6061

6162
### Spike Protection {#spike-protection}
6263

63-
Sentry's spike protection prevents huge overages in error events from consuming your event volume, and it's enabled for all accounts by default. You can confirm that spike protection is enabled in **Settings > Subscription**. Learn more about how spike protection works and how to manage spikes in [Manage Your Error Quota](/product/accounts/quotas/manage-event-stream-guide/#1-spike-protection).
64+
Sentry's Spike Protection checks for significant overages in error events, (as compared to an established spike threshold), on a per-project basis. If a spike is detected, Spike Protection kicks in, dropping events once they've reached a certain threshold.
65+
66+
Spike Protection can be enabled on a per-project basis for your organization by any team member with either **Billing or Owner-level permissions**. To select which project to set it up for, go to **Settings > Spike Protection**. You'll be able to toggle it on for individual projects or click “Enable All” to set it up for all your projects at once. Learn more about how spike protection works and how to manage spikes in [Spike Protection](/product/accounts/quotas/spike-protection/).
6467

6568
### Spend Allocation {#spend-allocation}
6669

67-
Spend Allocation gives you the ability to prioritize your most important projects, (or make sure that smaller projects don't get ignored). You can do this by setting aside a set amount of reserved volume, (errors, transactions, and attachments), to be used by those projects each month. This ensures that all the projects that are important to you are always monitored, regardless of the amount of volume other projects consume. Spend Allocation can be enabled on a per-project basis for your organization by any team member with either **Billing or Owner-level permissions**. To select which project to set it up for, go to **Settings > Spend Allocation**. Learn more about how [Spend Allocation works](./spend-allocation).
70+
Spend Allocation gives you the ability to prioritize your most important projects, (or make sure that smaller projects don't get ignored). You can do this by setting aside a set amount of reserved volume, (errors, transactions, and attachments), to be used by those projects each month. This ensures that all the projects that are important to you are always monitored, regardless of the amount of volume other projects consume. Spend Allocation can be enabled on a per-project basis for your organization by any team member with either Billing or Owner-level permissions. To select which project to set it up for, go to **Settings > Spend Allocation**. Learn more about how [Spend Allocation](/product/accounts/quotas/spend-allocation/) works.
6871

6972
### Adjusting Your Quota {#increasing-quotas}
7073

src/docs/product/accounts/quotas/manage-attachments-quota.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Manage Your Attachments Quota
33
keywords: ["best practices"]
4-
sidebar_order: 30
4+
sidebar_order: 50
55
description: "Learn how to use the tools Sentry provides to control the type and amount of attachments that you pay for."
66
---
77

src/docs/product/accounts/quotas/manage-event-stream-guide.mdx

Lines changed: 2 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Manage Your Error Quota
33
keywords: ["best practices"]
4-
sidebar_order: 10
4+
sidebar_order: 30
55
redirect_from:
66
- /guides/manage-event-stream/
77
description: "Learn how to use the tools Sentry provides to control the type and amount of errors that you pay for."
@@ -57,127 +57,7 @@ While this grace period isn't dependent on the [Spike Protection feature](#7-spi
5757

5858
## Spike Protection {#7-spike-protection}
5959

60-
A spike is both a **large** and **temporary** increase in error event volume. Sentry applies a dynamic rate limit to your account designed to protect you from short-term spikes.
61-
62-
Spike protection is enabled for your organization by default, and when it's enabled, Sentry continually monitors for spikes. You can confirm that it's enabled in **Settings > Subscription**. This page can only be accessed by a Billing or Owner member of your Sentry organization.
63-
64-
### How Does Spike Protection Work?
65-
66-
Because Sentry bills based on monthly event volume, spikes can easily consume your quota for the rest of the month. Sentry's spike protection prevents these types of overages from consuming your error event quota by dropping error events during the spike.
67-
68-
We use your historical error event volume to implement a dynamic rate limit, and then discard error events when you hit its threshold. When spike protection is activated, we limit the number of error events accepted in any minute to:
69-
70-
```
71-
maximum(20, 6 x average error events per minute over the last 24 hours)
72-
```
73-
74-
<Note>
75-
76-
The 24-hour window ends at the beginning of the current hour, not at the current minute.
77-
78-
</Note>
79-
80-
This means if you experience a spike, we'll temporarily protect you, but if the increase in volume is sustained, the spike protection limit will gradually **increase until Sentry accepts all events**.
81-
82-
For example, in the last 24 hours, your organization has been receiving, on average, 10 events per minute (after any inbound filters have been applied). That means your current per-minute limit is 6 \* 10 or 60 events. There have been no spikes in that time, so spike control is "inactive". Something breaks, and in the next minute, your organization sends Sentry 100 events. When we see the 61st event, three things happen:
83-
84-
1. Spike protection becomes "active".
85-
86-
1. If your organization has used more than 25% of your monthly quota, Sentry sends the organization owner a [notification](/product/alerts/notifications/#quota-notifications) including which project the 61st event came from. This is likely, but not guaranteed to be, the project in which something broke.
87-
88-
1. Events 61-100 are dropped with a 429 error code.
89-
90-
When the next minute begins, we again record up to 60 events, dropping the rest until the minute is up. It continues like this for the remainder of the hour. After an hour, we re-calculate your per-minute limit, and for the next hour use that limit to decide whether events get dropped each minute. We repeat this process every hour until Sentry eventually accepts all events.
91-
92-
If, instead of a single big spike (or an overall, permanent, increase in traffic), you experience many small spikes, there may be many days in a row when at least a few events are dropped. In that scenario, spike protection remains active the entire time.
93-
94-
Spike protection is an organization-level setting, so once it's triggered, it affects all the projects in the organization, regardless of which project triggered the spike.
95-
96-
### Managing a Spike {#-spike-protection-was-activated----what-should-i-do}
97-
98-
If spike protection has been triggered for your account, you'll receive an email notifying you:
99-
100-
![Spike Protection Email](spike-email.jpg)
101-
102-
To manage the current spike and avoid future spikes, we recommend taking the following steps:
103-
104-
- Set up an [on-demand budget](#on-demand-budget) to ensure you have time to adjust your volume in the event of a future spike in errors.
105-
- Set better [rate limits](#6-rate-limiting) on the DSN keys for the projects related to the spike.
106-
- If it's a specific release version that has caused the spike, add the version identifier to the project's [inbound filters](#3-inbound-data-filters) to avoid accepting events from that release.
107-
108-
To review the error events dropped because of spike protection, go to the "Usage Stats" tab of **Stats** for your Sentry org and select "Errors" in the "Category" dropdown.
109-
110-
### When Does Spike Protection Become "Inactive?"
111-
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-
114-
### New Spike Protection Calculations
115-
116-
<Include name="limited-avail-note.mdx" />
117-
118-
Limited availability spike protection is a project-level tool that helps prevent quota overconsumption. It's enabled for every project by default, and when it's enabled, Sentry continually monitors for spikes. You can confirm that it's enabled in **[Project] > Settings > General Settings**.
119-
120-
Our spike protection algorithm does the following:
121-
122-
- Uses a weighted average of your events over the past 168 hours (seven days)
123-
- Applies a multiplier to that number
124-
- Compares this final number against a minimum number of events, determined using your quota, to trigger a spike
125-
- Sets this as your spike limit
126-
127-
#### Setting the Spike Limit
128-
129-
There are two ways that we can set your spike limit, or the number of events that trigger a spike:
130-
131-
- [Minimum Event Calculation](#minimum-event-calculation) - A calculation that determines a minimum number of events
132-
- [Usage-Based Calculation](#usage-based-calculation) - A projection based on your past usage
133-
134-
The spike limit for each hour is set using either the minimum event or usage-based calculation — whichever is higher. This is done for a number of reasons. Firstly, using a minimum event calculation protects smaller or new projects. New projects that don't have a week’s worth of data to use to calibrate spike limits can use this minimum number of events, an adaptation of the organization’s quota, to approximate appropriate limits. Additionally, this calculation can be used to minimize false positives in smaller or new projects so that spikes aren’t flagged incorrectly.
135-
136-
Spike limits are recalculated in real time throughout the duration of the spike to adjust for the increasing volume of incoming events. This allows the limit to grow at a steady rate such that quota is protected from being quickly consumed. [An example](#example) of how this works during a spike is shown below.
137-
138-
##### Minimum Event Calculation
139-
140-
This calculation, which is the first step of our algorithm, identifies a minimum number of events, using your quota as a guide. This number takes the maximum of either 500 events or the result of the following formula `(3 \* your quota)/(720 \* number of projects)`. The equation represents your project using up three times your overall quota in 30 days if events are continually ingested at this hourly rate, thus flagging the project for a potential spike.
141-
142-
##### Usage-Based Calculation
143-
144-
This calculation, which is the second step of our algorithm, calculates hourly data from the past seven days to determine spike limit projections for the next seven 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 the 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`.
145-
146-
#### Example
147-
148-
In this example, the project usually ingests 100-200 events per hour. There's been a spike that’s reached 50,000 events, as shown in the graph below:
149-
![Spike zoomed out](spike-protection-zoomed-out.png)
150-
151-
In the following graph, we can see a zoomed in perspective of the 12-hour period of the spike, along with a line indicating the spike limit as it’s being recalculated over the course of the spike:
152-
![Spike zoomed in plotted with spike limits](spike-protection-zoomed-in.png)
153-
154-
Throughout the spike, the recalulating limit has the following effect:
155-
156-
- 1st hour: 6k events ingested, limit is recalculated to 2083, 3917 events dropped
157-
- 2nd hour: 34k events ingested, limit is recalculated to 2873, 31217 events dropped
158-
- 3rd hour: 55k events ingested, limit is recalculated to 5452, ~49k events dropped
159-
- 4th hour: 49k events ingested, limit is recalculated to 7628, ~41k events dropped
160-
- 5th hour: 41k events ingested, limit is recalculated to 9371, ~31k events dropped
161-
162-
For this particular example:
163-
164-
- Org quota: 500k
165-
- Events ingested during the spike: ~478k
166-
- Events accepted overall: ~157k
167-
168-
Here's an example of spike limit projections for a week, taking into account seasonality:
169-
170-
![Spike limit projections with seasonality](spike-protection-steady-state.png)
171-
172-
These regular differences in event ingestion don't cause a spike to occur.
173-
174-
#### Bursty Projects
175-
176-
There may be instances where a project routinely accepts a high volume of events in a very short period of time by design — for example projects that orchestrate cron/Airflow jobs or task runners. The screenshot below shows an example of this kind of behavior:
177-
178-
![A "bursty" project with intentional spikes.](bursty_projects.png)
179-
180-
If this is expected behavior for a given project in your organization, you may want to consider turning off spike protection in the project settings to ensure necessary events aren't dropped.
60+
Sentry's Spike Protection checks for significant overages in error events, (as compared to an established spike threshold), on a per-project basis. If a spike is detected, Spike Protection kicks in, dropping events once they've reached the spike threshold. Spike Protection can be enabled on a per-project basis for your organization by any team member with either Billing or Owner-level permissions. To select which project to set it up for, go to Settings > Spike Protection. You'll be able to toggle it on for individual projects or click “Enable All” to set it up for all your projects at once. Learn more about how Spike Protection works and how to manage spikes in [Spike Protection](/product/accounts/quotas/spike-protection/).
18161

18262
## Adjusting Quotas
18363

src/docs/product/accounts/quotas/manage-replay-quota.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Manage Your Replay Quota
33
keywords: ["best practices"]
4-
sidebar_order: 40
4+
sidebar_order: 60
55
description: “Learn how to use Sentry’s tools to manage the amount and types of replays you pay for.”
66
---
77

src/docs/product/accounts/quotas/manage-transaction-quota.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Manage Your Transaction Quota
33
keywords: ["best practices"]
4-
sidebar_order: 20
4+
sidebar_order: 40
55
description: "Learn how to use the tools Sentry provides to control the type and amount of transactions that you pay for."
66
---
77

@@ -12,9 +12,9 @@ Applying the proper SDK configuration is an iterative and on-going process, but
1212
## Before You Begin: Check Your Quota Usage {#3-event-usage-stats}
1313

1414
<Alert title="Note" level="info">
15-
15+
1616
<p>The "Usage Stats" tab is only visible if you're on a Team, Business, or Enterprise plan.</p>
17-
17+
1818
</Alert>
1919

2020
You can look at your events in aggregate in the "Usage Stats" tab of **Stats**. This information will help you answer key questions about the breakdown of your incoming events or which projects are consuming your quota. The answers to these questions can help you figure out where you need to do further fine-tuning of your SDK filters and configuration.

src/docs/product/accounts/quotas/spend-allocation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Spend Allocation"
3-
sidebar_order: 5
3+
sidebar_order: 20
44
description: "Learn how to make sure your important projects get monitored with spend allocation."
55
---
66

Loading
Loading
Loading

0 commit comments

Comments
 (0)