Skip to content

Commit 422579d

Browse files
coolguyzoneAlex Krawiecsfanahata
authored
First pass at logs quota doc (#14671)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR *Tell us what you're changing and why. If your PR **resolves an issue**, please link it so it closes automatically.* ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: Shannon Anahata <[email protected]>
1 parent b20a915 commit 422579d

File tree

2 files changed

+147
-21
lines changed

2 files changed

+147
-21
lines changed

docs/pricing/quotas/index.mdx

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_order: 70
44
description: "Learn about what counts towards your quota and how to manage your quota."
55
---
66

7-
Data and quotas are interconnected in Sentry. When you [subscribe to Sentry](https://sentry.io/pricing/), you pay for the amount of data - events (errors, replays, spans or transactions, and profiles), and attachments - to be tracked. Each data category has its own quota that you can adjust. When Sentry tracks an event or attachment, it counts toward your quota for that type of data.
7+
Data and quotas are interconnected in Sentry. When you [subscribe to Sentry](https://sentry.io/pricing/), you pay for the amount of data - events (errors, replays, spans or transactions, and profiles), logs, and attachments - to be tracked. Each data category has its own quota that you can adjust. When Sentry tracks an event, log, or attachment, it counts toward your quota for that type of data.
88

99
To see which projects are using up your quota, you can review the "Usage" tab of **Stats**. This page can be viewed by any member of your organization. In addition, you can come back to this page to check if the changes you've made are having the desired effect:
1010

@@ -19,26 +19,27 @@ Sentry's flexibility means you can exercise fine-grained control over which even
1919
- [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/)
2020
- [Manage Your Replay Quota](/pricing/quotas/manage-replay-quota/)
2121
- [Manage Your Attachments Quota](/pricing/quotas/manage-attachments-quota/)
22+
- [Manage Your Logs Quota](/pricing/quotas/manage-logs-quota/)
2223

2324
## How to Manage Your Quota
2425

25-
There are a number of things you can do to manage your quota, as shown in the table below. Actions are listed in order from easiest and fastest, to most challenging and potentially time-consuming. The checkmarks tell you whether the action helps you manage errors, spans, replays, attachments, or some combination of the four.
26+
There are a number of things you can do to manage your quota, as shown in the table below. Actions are listed in order from easiest and fastest, to most challenging and potentially time-consuming. The checkmarks tell you whether the action helps you manage errors, spans, replays, attachments, logs, or some combination of the five.
2627

2728
The first 6 actions in the list can all be done in [sentry.io](https://sentry.io), while the rest have to be done in an SDK.
2829

2930
{/*<!-- prettier-ignore-start -->*/}
3031

31-
| Action | Errors | Spans | Replays |Attachments |
32-
| ------ | ------ | ------------ | ----------- |----------- |
33-
| [Ensure spike protection is enabled](#spike-protection) | &check; | &check; | | &check; |
34-
| [Adjust your quota](#adjusting-your-quota) | &check; | &check; | &check; | &check; |
35-
| [Rate limit your events or attachments](#rate-limits) | &check; | | | &check; |
36-
| [Review repeated events](#event-repetition) | &check; | | | |
37-
| [Filter your events](#inbound-filters) | &check; | &check; | | &check; |
38-
| [Update your SDK sample rate](#sdk-sample-rate) | &check; | &check; | | |
39-
| [Apply SDK filtering](#sdk-filtering-beforesend-and-beforesendtransaction) | &check; | &check; | | |
40-
| [Update your SDK configuration](#sdk-configuration) | &check; | &check; | | |
41-
| [Manage data size](#size-limits) | &check; | &check; | | &check; |
32+
| Action | Errors | Spans | Replays | Attachments | Logs |
33+
| ------ | ------ | ------------ | ----------- | ----------- | ---- |
34+
| [Ensure spike protection is enabled](#spike-protection) | &check; | &check; | | &check; | |
35+
| [Adjust your quota](#adjusting-your-quota) | &check; | &check; | &check; | &check; | &check; |
36+
| [Rate limit your events or attachments](#rate-limits) | &check; | | | &check; | |
37+
| [Review repeated events](#event-repetition) | &check; | | | | |
38+
| [Filter your events](#inbound-filters) | &check; | &check; | | &check; | &check; |
39+
| [Update your SDK sample rate](#sdk-sample-rate) | &check; | &check; | | | &check; |
40+
| [Apply SDK filtering](#sdk-filtering-beforesend-and-beforesendtransaction) | &check; | &check; | | | &check; |
41+
| [Update your SDK configuration](#sdk-configuration) | &check; | &check; | | | &check; |
42+
| [Manage data size](#size-limits) | &check; | &check; | | &check; | &check; |
4243

4344
{/*<!-- prettier-ignore-end -->*/}
4445

@@ -62,7 +63,7 @@ Spike Protection can be enabled on a per-project basis for your organization by
6263

6364
### Adjusting Your Quota
6465

65-
Events and attachments that exceed your quota will not be accepted, so you may want to increase your quota. Conversely, you might want to decrease your quota or adjust your reserved and pay-as-you-go quotas to better control your spending. Learn about adjusting your quota in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#adjusting-quotas), [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/), [Manage your Replay Quota](/pricing/quotas/manage-replay-quota/), and [Manage Your Attachments Quota](/pricing/quotas/manage-attachments-quota/#adjusting-quotas).
66+
Events and attachments that exceed your quota will not be accepted, so you may want to increase your quota. Conversely, you might want to decrease your quota or adjust your reserved and pay-as-you-go quotas to better control your spending. Learn about adjusting your quota in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#adjusting-quotas), [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/), [Manage your Replay Quota](/pricing/quotas/manage-replay-quota/), [Manage Your Attachments Quota](/pricing/quotas/manage-attachments-quota/#adjusting-quotas), and [Manage Your Logs Quota](/pricing/quotas/manage-logs-quota/#adjusting-payg-budget).
6667

6768
### Rate Limits
6869

@@ -74,19 +75,19 @@ In some cases, repeated events can count against your quota, so it's important t
7475

7576
### Inbound Filters
7677

77-
If an inbound filter is applied for a type of error, transaction/span, or attachment, and your subscription allows, it won't be counted. You can manage these in **[Project] > Settings > Inbound Filters**. Learn more in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#inbound-data-filters), [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/#inbound-filters), [Manage your Replay Quota](/pricing/quotas/manage-replay-quota/), and [Manage Your Attachments Quota](/pricing/quotas/manage-attachments-quota/#inbound-data-filters).
78+
If an inbound filter is applied for a type of error, transaction/span, or attachment, and your subscription allows, it won't be counted. You can manage these in **[Project] > Settings > Inbound Filters**. Learn more in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#inbound-data-filters), [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/#inbound-filters), [Manage your Replay Quota](/pricing/quotas/manage-replay-quota/), [Manage Your Attachments Quota](/pricing/quotas/manage-attachments-quota/#inbound-data-filters), and [Manage Your Logs Quota](/pricing/quotas/manage-logs-quota/#logs-filtering).
7879

7980
### SDK Sample Rate
8081

81-
If a sample rate is defined for the SDK, the SDK evaluates whether this event should be sent as a representative fraction of events, effectively limiting the number of errors and transactions/spans you send to Sentry. Setting a sample rate is documented [for each SDK](/platform-redirect/?next=/configuration/sampling/), but you can also learn more in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#sdk-sample-rate) and [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/#sdk-configuration-tracing-options/).
82+
If a sample rate is defined for the SDK, the SDK evaluates whether this event should be sent as a representative fraction of events, effectively limiting the number of errors and transactions/spans you send to Sentry. For logs, many SDKs support sampling to reduce the volume of logs sent. Setting a sample rate is documented [for each SDK](/platform-redirect/?next=/configuration/sampling/), but you can also learn more in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#sdk-sample-rate), [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/#sdk-configuration-tracing-options/), and [Manage Your Logs Quota](/pricing/quotas/manage-logs-quota/#sdk-configuration).
8283

8384
### SDK Filtering: `beforeSend` and `beforeSendTransaction`
8485

85-
All Sentry SDKs support the `beforeSend` callback method, which you can use to modify the data of an error event or to drop it completely. Many also support `beforeSendTransaction`. Learn more in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#sdk-filtering-beforesend) and [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/#sdk-filtering-beforesendtransaction).
86+
All Sentry SDKs support the `beforeSend` callback method, which you can use to modify the data of an error event or to drop it completely. Many also support `beforeSendTransaction`. For logs, many SDKs support `beforeSendLog` for filtering log entries. Learn more in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#sdk-filtering-beforesend), [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/#sdk-filtering-beforesendtransaction), and [Manage Your Logs Quota](/pricing/quotas/manage-logs-quota/#sdk-configuration).
8687

8788
### SDK Configuration
8889

89-
The SDK configuration either allows an event to be sent to Sentry or filters it out. Configuration is documented [for each SDK](/platform-redirect/?next=/configuration/filtering/), but you can also learn more in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#sdk-configuration) and [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/#sdk-configuration-tracing-options).
90+
The SDK configuration either allows an event to be sent to Sentry or filters it out. Configuration is documented [for each SDK](/platform-redirect/?next=/configuration/filtering/), but you can also learn more in [Manage Your Error Quota](/pricing/quotas/manage-event-stream-guide/#sdk-configuration), [Manage Your Span Quota](/pricing/quotas/manage-transaction-quota/#sdk-configuration-tracing-options), and [Manage Your Logs Quota](/pricing/quotas/manage-logs-quota/#sdk-configuration).
9091

9192
### Size Limits
9293

@@ -112,22 +113,24 @@ Use this table as a quick reference for what does and doesn't count towards your
112113
| The event is sent after the [SDK sample rate](#sdk-sample-rate) has been exceeded | |
113114
| The event isn't sent based on [SDK filters](#sdk-filtering-beforesend-and-beforesendtransaction) | |
114115
| The event isn't sent based on [SDK configuration](#sdk-configuration) | |
116+
| The log is filtered by [logs filtering](#inbound-filters) configured in sentry.io | |
115117
| [Size limits](#size-limits) have been exceeded | |
116118

117119
{/*<!-- prettier-ignore-end -->*/}
118120

119-
Sentry groups accepted errors and spans into issues. The issues themselves don't count towards your quota, but the errors and spans that comprise an issue are counted.
121+
Sentry groups accepted errors and spans into issues. The issues themselves don't count towards your quota, but the errors and spans that comprise an issue are counted. Logs are counted individually and do not get grouped into issues.
120122

121123
## Key Terms
122124

123125
Let's clarify a few terms:
124126

125127
- **Attachment** - Attachments are stored additional files, such as config files, log files, or stored mini-dumps, that are related to an error event. Unless the option to store crash reports is enabled, Sentry will use these files only to create an event, and then drop them.
126128
- **Cron Monitor** - A Cron Monitor represents a set of configurations for a scheduled, recurring job such as a "Data Backup" job that runs daily on production and development.
127-
- **Data** - Anything you send to Sentry. This includes events (errors, spans, or replays), attachments, and event metadata.
129+
- **Data** - Anything you send to Sentry. This includes events (errors, spans, or replays), logs, attachments, and event metadata.
128130
- **Error** - What counts as an error varies by platform, but in general, if there's something that looks like an exception, it can be captured as an error in Sentry. Sentry automatically captures errors, uncaught exceptions, and unhandled rejections, as well as other types of errors, depending on platform. A grouping of similar errors makes [an issue](/product/issues/).
129131
- **Event** - An event is one instance of you sending data to Sentry, excluding attachments. Generally, this data is an error or a transaction/span.
132+
- **Logs** - Structured log entries sent from your applications that provide visibility into application behavior, debugging information, and user interactions.
130133
- **Replay** - Session Replays are video-like reproductions of users' sessions as they navigate your app or website.
131134
- **Span** - A billing unit in Sentry that maps to span usage. Also the basic unit that [traces](/concepts/key-terms/tracing/distributed-tracing/) are composed of. Multiple spans make up a trace in Sentry and share a trace_id.
132135
- **Profile** - A snapshot of your code's resource usage obtained by periodically capturing the call stack as your application runs.
133-
- **Quota** - Your quota is the amount of data (errors, spans, replays, attachments) that you pay Sentry to track.
136+
- **Quota** - Your quota is the amount of data (errors, spans, replays, logs, attachments) that you pay Sentry to track.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: Manage Your Logs Quota
3+
sidebar_order: 45
4+
description: "Understand where and how to manage your Logs quota, see how much each project is consuming, and learn how to increase or decrease your spend."
5+
---
6+
7+
<Alert>
8+
[Logs](/product/explore/logs/) is currently available on Team, Business, and Developer plans. These plans include a certain amount of Logs data to be processed and stored. Once you exceed your included quota, you'll be charged based on your pay-as-you-go (PAYG) budget.
9+
</Alert>
10+
11+
## Key Terms
12+
13+
- **Logs Quota**: The initial quota your subscription has allocated for processing and storing log data from your applications.
14+
15+
- **Pay-As-You-Go (PAYG) Budget**: A budget you set to pay for additional log processing beyond your included quota.
16+
17+
- **Log Entry**: A single log message sent from your application to Sentry, including metadata like timestamp, log level, and custom attributes.
18+
19+
- **Log Processing**: The ingestion, parsing, indexing, and storage of log data in Sentry's infrastructure.
20+
21+
## Before You Begin: Check Your Logs Usage
22+
23+
You can look at your Logs usage on the Stats & Usage page to understand the breakdown of your log entries by time window and project. This may help you figure out where you need to further fine-tune your usage.
24+
25+
This page is accessible to all members of your organization, so Owners in your Sentry org will be able to share it with the developers directly responsible for a given project. You'll also be able to use this page to assess whether your changes are working as intended.
26+
27+
### How Can I See a Breakdown of Incoming Logs?
28+
29+
The Stats & Usage page also displays details about the total amount of log data Sentry has received across your entire org for up to 90 days. The page breaks down the events by project into three categories: accepted, dropped, or filtered. Only accepted logs affect your quota:
30+
31+
![Stats and Usage page example](./img/usage-stats-errors.png)
32+
33+
### Which Projects Are Consuming My Logs Spend?
34+
35+
The "Projects" table on the Stats page breaks down your data by project, so you can identify the ones that are consuming the most quota. These can be sorted by total logs, accepted logs, filtered logs, and so on.
36+
37+
## Adjusting PAYG Budget
38+
39+
Budgets can only be updated by a Billing- or Owner-level member of your Sentry org.
40+
41+
Once your Logs quota is approaching or has exceeded its included amount, teammates with "Owner" org permissions will start receiving [notification](/product/alerts/notifications/#quota-notifications) emails. They'll then be able to choose to increase or decrease the PAYG budget to unlock additional usage.
42+
43+
### Increasing Logs Budget
44+
45+
If you're not able to send new logs because you've exceeded your Logs quota, you can add to your budget at any time during your billing period by increasing your PAYG budget. This is ideal in situations where you're rolling out a new version of your application or need to increase logging for debugging purposes. To add PAYG budget, set a monthly maximum shared budget in your [Subscriptions Page](https://sentry.io/orgredirect/organizations/:orgslug/settings/billing).
46+
47+
[Learn more about setting your PAYG budget](/pricing/#pricing-how-it-works).
48+
49+
## Managing Spend
50+
51+
### SDK Configuration
52+
53+
For various SDKs, there's the ability to filter out logs before sending to Sentry, so you can avoid sending logs you don't care about. This is the most effective way to reduce your Logs quota usage; below are a couple of examples:
54+
55+
#### JavaScript SDKs
56+
57+
```js
58+
Sentry.init({
59+
dsn: "___PUBLIC_DSN___",
60+
enableLogs: true,
61+
beforeSendLog: (log) => {
62+
if (log.level === "info") {
63+
// Filter out all info logs
64+
return null;
65+
}
66+
return log;
67+
},
68+
});
69+
```
70+
71+
#### Python SDK
72+
73+
```python
74+
import sentry_sdk
75+
from sentry_sdk.types import Log, Hint
76+
from typing import Optional
77+
78+
def before_log(log: Log, _hint: Hint) -> Optional[Log]:
79+
# Filter out all info level logs
80+
if log["severity_text"] == "info":
81+
return None
82+
return log
83+
84+
sentry_sdk.init(
85+
dsn="___PUBLIC_DSN___",
86+
"enable_logs": True,
87+
"before_send_log": before_log,
88+
)
89+
```
90+
91+
### Logs Filtering
92+
93+
You can also use [Inbound Filters](/concepts/data-management/filtering/#logs-filtering) to filter logs at the server level. While this doesn't prevent data from being sent to Sentry, it does prevent filtered logs from counting against your quota.
94+
95+
The following inbound filters apply to Logs:
96+
97+
- **Log Message** - Filters logs based on the log message match
98+
- **Releases** - Filters logs from specific release versions
99+
100+
To set up log message filtering:
101+
102+
1. Navigate to **[Project] > Project Settings > Inbound Filters**
103+
2. Add patterns to filter out specific log messages
104+
3. Use wildcards for flexible matching, for example, `*Connection timeout*` , to filter all logs containing "Connection timeout")
105+
106+
### Best Practices for Reducing Logs Quota Usage
107+
108+
1. **Set appropriate log levels**: Only log at the level you need for production, for example, WARNING and above.
109+
2. **Use structured logging**: Include relevant context in log attributes rather than verbose messages
110+
4. **Filter at the source**: Use `beforeSendLog` callbacks to filter logs before they're sent
111+
5. **Monitor usage patterns**: Regularly check your Usage Stats to identify projects with high log consumption
112+
6. **Set up alerts**: Configure notifications when you approach your quota limits
113+
114+
### Monitoring Your Logs Usage
115+
116+
Keep track of your Logs quota usage by:
117+
118+
- Checking the [Usage Stats](/product/stats/#usage-stats) page regularly
119+
- Setting up [quota notifications](/product/alerts/notifications/#quota-notifications)
120+
- Reviewing project-specific usage in the Stats breakdown
121+
- Monitoring the impact of filtering changes over time
122+
123+
By implementing these strategies, you can effectively manage your Logs quota while maintaining the visibility you need into your application's behavior.

0 commit comments

Comments
 (0)