Skip to content

Commit 1f53feb

Browse files
authored
Merge branch 'master' into rz/feat/android-screenshot-masking-docs
2 parents d42703b + d50dbde commit 1f53feb

File tree

309 files changed

+6236
-2091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+6236
-2091
lines changed

.github/workflows/bump-api-schema-sha.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4.1.1
1515
- name: Get auth token
1616
id: token
17-
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
17+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
1818
with:
1919
app-id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
2020
private-key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}

.github/workflows/codeowner_assignment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16-
- uses: actions/create-github-app-token@v2.0.6
16+
- uses: actions/create-github-app-token@v2.2.1
1717
id: token
1818
with:
1919
app-id: ${{ vars.CODEOWNER_ASSIGNMENT_GITHUB_APP_ID }}

app/[[...path]]/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ export default async function Page(props: {params: Promise<{path?: string[]}>})
126126
const pageNode = nodeForPath(rootNode, params.path ?? '');
127127

128128
if (!pageNode) {
129-
// eslint-disable-next-line no-console
130-
console.warn('no page node', params.path);
131129
return notFound();
132130
}
133131

app/not-found.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function NotFound() {
3939
const reportUrl = `https://github.com/getsentry/sentry-docs/issues/new?template=issue-platform-404.yml&title=🔗 404 Error&url=${brokenUrl}`;
4040
return (
4141
<div className="tw-app">
42-
<Header pathname="/" searchPlatforms={[]} noSearch />
42+
<Header pathname="/" searchPlatforms={[]} noSearch platforms={[]} />
4343
<main className="px-8 pt-28">
4444
<h1 className="font-medium text-3xl mb-4">Page Not Found</h1>
4545
<p className="text-lg">We couldn't find the page you were looking for :(</p>

develop-docs/engineering-practices/commit-messages.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ sidebar_order: 10
1616

1717
### Merge vs Rebase
1818

19-
Sentry uses a rebase workflow. That means that every commit on its own should be a clear, functional, and stable change. This means then when you’re building a new feature, you should try to pare it down into functional steps, and when that’s not reasonable, the end patch should be a single commit. This is counter to having a Pull Request which may include “fix [unmerged] behavior”. Those commits should be squashed, and the final patch when landed should be rebased.
19+
Sentry uses a rebase workflow. That means that every commit on its own should be a clear, functional, and stable change. This means that when you’re building a new feature, you should try to pare it down into functional steps, and when that’s not reasonable, the end patch should be a single commit. This is counter to having a Pull Request which may include “fix [unmerged] behavior”. Those commits should be squashed, and the final patch when landed should be rebased.
2020

2121
Remember: each commit should follow the commit message format and be stable (green build).
2222

2323
#### Rebase and Merge
2424

25-
The GitHub UI exposes a “Rebase and Merge” option, which, if your commits are already in following the commit guidelines, is a great way to bring your change into the codebase.
25+
The GitHub UI exposes a “Rebase and Merge” option, which, if your commits already follow the commit guidelines, is a great way to bring your change into the codebase.
2626

2727
#### Squashing
2828

@@ -46,7 +46,7 @@ The header has a special format that includes a type, a scope and a subject:
4646

4747
The **header** is mandatory and the **scope** of the header is optional. If you have a Jira issue to link to, add the **jira-id** the commit belongs to. This helps to connect changes back to Jira tickets.
4848

49-
Any line of the commit message should not be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
49+
Any line of the commit message should not be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
5050

5151
The footer should contain a closing reference to an issue as well as a relevant Sentry issue if any.
5252

develop-docs/sdk/expected-features/setup-wizards/index.mdx renamed to develop-docs/sdk-setup-wizards/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Setup Wizards
2+
title: SDK Setup Wizards
33
sidebar_order: 3
44
og_image: /og-images/sdk-expected-features-setup-wizards.png
55
---

develop-docs/sdk/expected-features/setup-wizards/setup-wizard-copy-paste.png renamed to develop-docs/sdk-setup-wizards/setup-wizard-copy-paste.png

File renamed without changes.

develop-docs/sdk/expected-features/data-handling.mdx

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -111,45 +111,3 @@ This helps Relay to know what kind of data it receives and this helps with scrub
111111

112112
Additionally all semantic conventions of OpenTelemetry for database spans should be set in the `span.data` if applicable:
113113
https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/database/
114-
115-
### Breadcrumbs
116-
117-
If the `message` in a breadcrumb contains an URL it should be formatted the same way as in `http` spans (see above).
118-
If query strings are present in the URL or fragments (Browser SDKs only) are present in the URI, both should also be set in the data attribute like with `http` spans.
119-
120-
```js
121-
Sentry.addBreadcrumb({
122-
type: "http",
123-
category: "xhr",
124-
data: {
125-
method: "POST",
126-
url: "https://example.com/api/users/create.php",
127-
"http.query": "username=ada&password=123&newsletter=0",
128-
"http.fragment": "#foo",
129-
},
130-
});
131-
```
132-
133-
Additionally all semantic conventions of OpenTelemetry for database spans should be set in the `data` if applicable:
134-
https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/database/
135-
136-
## Variable Size
137-
138-
Fields in the event payload that allow user-specified or dynamic values are restricted in size. This applies to most meta data fields, such as variables in a stack trace, as well as contexts, tags and extra data:
139-
140-
- Event IDs are limited to 36 characters and must be valid UUIDs.
141-
- Flag keys are limited to 32 characters.
142-
- Flag values are limited to 200 characters.
143-
- Tag keys are limited to 200 characters.
144-
- Tag values are limited to 200 characters.
145-
- Culprits are limited to 200 characters.
146-
- Context objects are limited to 8kB.
147-
- Individual extra data items are limited to 16kB. Total extra data is limited to 256kb.
148-
- Messages are limited to 8192 characters.
149-
- HTTP data (the body) is limited to 8kB. Always trim HTTP data before attaching it to the event.
150-
- Stack traces are limited to 50 frames. If more are sent, data will be removed from the middle of the stack.
151-
- Input messages in AI integrations recorded in the span attribute `gen_ai.request.messages` are limited to 20kB per span. Messages are trimmed and truncated if they exceed the limit, retaining the most recent messages.
152-
153-
Additionally, size limits apply to all store requests for the total size of the request, event payload, and attachments. Sentry rejects all requests exceeding these limits. Please refer the following resources for the exact size limits:
154-
155-
- <Link to="/sdk/foundations/transport/envelopes/#size-limits">Envelope Endpoint Size Limits</Link>

develop-docs/sdk/expected-features/index.mdx

Lines changed: 3 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -4,173 +4,8 @@ description: The following is a description of features that are commonly expect
44
sidebar_order: 5
55
---
66

7-
<Alert title="SDK Foundations" level="info">
8-
Make sure to also read the <Link to="/sdk/foundations/">Foundations</Link> documentation,
7+
<Alert title="Content Moved" level="info">
8+
Error monitoring features have been moved to the <Link to="/sdk/telemetry/errors/">Errors</Link> telemetry spec.
9+
See also the <Link to="/sdk/foundations/">Foundations</Link> documentation,
910
including the <Link to="/sdk/foundations/state-management/scopes/">Scopes</Link> and <Link to="/sdk/foundations/client/">Client</Link> specs.
1011
</Alert>
11-
12-
## Background Sending
13-
14-
Events should be transmitted in a background thread or similar system. This queue must be flushed when the
15-
application shuts down with a specific timeout. This feature is typically user facing and explained
16-
as part of [shutdown and draining](https://docs.sentry.io/platforms/javascript/configuration/draining/).
17-
18-
19-
## Uncaught Exception Handler
20-
21-
Ability for the SDK to be set as a hook to record any uncaught exceptions. At the language level this is typically a global hook provided by the language itself. For framework integrations this might be part of middleware or some other system.
22-
23-
This behavior is typically provided by a default integration that can be disabled.
24-
25-
## Automatic Context Data
26-
27-
Automatic addition of useful attributes such as `flags` or `tags` or `extra` or specific `contexts`. Typically means the SDK hooks into a framework so that it can set attributes that are known to be useful for most users. Please check [Data Handling](/sdk/expected-features/data-handling) for considerations.
28-
29-
## Rate Limiting
30-
31-
Respect Sentry's HTTP 429 `Retry-After` header, or, if the SDK supports multiple payload types (e.g. errors and transactions), the `X-Sentry-Rate-Limits` header. Outgoing SDK requests should be dropped during the backoff period.
32-
33-
See <Link to="/sdk/expected-features/rate-limiting">Rate Limiting</Link> for details.
34-
35-
36-
## Backpressure Management
37-
38-
Backend SDKs (typically used in server applications) should have backpressure management logic that dynamically downsamples transactions when the throughput in the system is too high.
39-
40-
See <Link to="/sdk/telemetry/traces/backpressure/">Backpressure Management</Link> for details.
41-
42-
## In-App frames
43-
44-
Stack parsing can tell which frames should be identified as part of the user's application (as opposed to part of the language, a library, or a framework), either automatically or by user configuration at startup, often declared as a package/module prefix.
45-
46-
## Surrounding Source in Stack Trace
47-
48-
Lines of source code to provide context in stack traces. This is easier in interpreted languages, may be hard or impossible in compiled ones.
49-
50-
## Local Variables
51-
52-
Local variable names and values for each stack frame, where possible. Restrictions apply on some platforms, for example it may only be possible to collect the values of parameters passed into each function, or it may be completely impossible to collect this information at all.
53-
54-
This functionality should be gated behind the `includeLocalVariables` option, which is `true` by default.
55-
56-
## Desymbolication
57-
58-
Turn compiled or obfuscated code/method names in stack traces back into the original. Desymbolication always requires Sentry backend support. Not necessary for many languages.
59-
60-
## Retrieve Last Event ID
61-
62-
Ability to get the ID of the last event sent. Event IDs are useful for correlation, logging, customers rolling their own feedback forms, etc.
63-
64-
## List Loaded Libraries
65-
66-
Include a list of loaded libraries (and versions) when sending an event.
67-
68-
## Buffer to Disk
69-
70-
This feature is also known as 'Offline Caching'.
71-
72-
Write events to disk before attempting to send, so that they can be retried in the event of a temporary network failure. Needs to implement a cap on the number of stored events. This is mostly useful on mobile and desktop(e.g: laptop) apps, where stable connectivity is often not available.
73-
74-
### Dealing With Network Failures
75-
76-
When SDKs receive an `HTTP 2xx` status code response from Sentry, they **MUST** consider it as a successful send.
77-
78-
If Sentry returns an `HTTP 4xx` or `HTTP 5xx` status code, SDKs **MUST** discard the envelope and record a [client report](/sdk/telemetry/client-reports/#network-failure-recording) as specified in the client reports spec.
79-
80-
For an [`HTTP 413 Content Too Large`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413) response, SDKs:
81-
82-
* **MUST** discard the envelope and record a [client report](/sdk/telemetry/client-reports/#network-failure-recording).
83-
* **MUST NOT** retry sending the envelope.
84-
* **SHOULD** log an error, informing users that the envelope was discarded due to size limits.
85-
* **MAY** add information from the response body to the logged error. If doing so, SDKs **MUST** be aware that Relay can change or remove information in the response body for an `HTTP 413` at any time without notice.
86-
87-
For an [`HTTP 429 Too Many Requests`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) response, SDKs:
88-
89-
- **MUST** respect the [rate limiting rules](/sdk/expected-features/rate-limiting/), such as correctly parsing the retry-header.
90-
- **MUST** discard the envelope, but **MUST NOT** record a [client report](/sdk/telemetry/client-reports/#network-failure-recording), because the upstream already does this.
91-
- **MUST NOT** retry sending the envelope.
92-
93-
SDKs **MAY** retry sending the envelope when a network error occurs, such as:
94-
95-
* Connection timeout
96-
* DSN resolution failure
97-
* Connection reset by peer
98-
99-
When other failures occur, like those caused by processing the file in the SDK itself, SDKs **MUST** discard the envelope and record a [client report](/sdk/telemetry/client-reports/#network-failure-recording) with the discard reason `internal_sdk_error`. Otherwise, the SDK might end up in an endless retry loop.
100-
101-
See the [Client Reports — Network Failure Recording](/sdk/telemetry/client-reports/#network-failure-recording) spec for the full set of client report recording requirements for each HTTP status code.
102-
103-
104-
#### Additional capabilities
105-
106-
Consider having the SDK retry sending events once the device is back online, when such notification exists in the platform.
107-
108-
Once the device is back online, the SDK is likely going to empty its disk queue in a quick burst of requests. This can trigger different abuse filters in Sentry. To account for that, it's considered to add a small delay between cached event captures. A recommended value is 100 milliseconds.
109-
110-
If the SDK is being [rate-limited](/sdk/expected-features/rate-limiting/), which causes the SDK to drop any event that reaches its HTTP transport, consider stop consuming the disk cache until the `Retry-After` timeout is reached or the app restarts.
111-
112-
#### Example implementations
113-
114-
- [C#](https://github.com/getsentry/sentry-dotnet/blob/main/src/Sentry/Internal/Http/CachingTransport.cs)
115-
- [Java](https://github.com/getsentry/sentry-java/blob/main/sentry/src/main/java/io/sentry/cache/EnvelopeCache.java)
116-
- [Objective-C](https://github.com/getsentry/sentry-cocoa/blob/master/Sources/Sentry/SentryHttpTransport.m)
117-
- [TypeScript](https://github.com/getsentry/sentry-electron/blob/master/src/main/transports/electron-offline-net.ts)
118-
119-
## Start-Up Crash Detection
120-
121-
We recommend implementing this feature for mobile and desktop SDKs.
122-
123-
If the application crashes shortly after the init of the SDK, the SDK should provide a mechanism to guarantee transmission
124-
to Sentry. Ideally, SDKs could send the events in a separate process not impacted by the crashing application. With the
125-
limitations on mobile platforms, spawning an extra process only for sending envelopes is hard to achieve or impossible.
126-
The SDKs on these platforms send envelopes on a background thread to not block the UI thread or because they forbid network
127-
operations on the UI thread. A crash occurring shortly after the SDK init could lead to never reporting such crashes,
128-
keeping the users unaware of a critical bug.
129-
130-
When the app crashes, the SDK needs to check if it happens within two seconds after the SDK init. If it does, it needs to store
131-
that information on the disk. We recommend using a marker file, which the SDK checks on initialization. Suppose the SDK
132-
allows storing this information in another place to avoid creating an additional marker file and causing extra IO. In that
133-
case, the recommendation is to use such an approach to prevent additional IO. We accept the tradeoff of extra IO to be able
134-
to detect start-up crashes.
135-
136-
If the platform allows it, the SDK may call flush directly after the detected start-up crash occurs and before the
137-
application terminates. If the SDK can guarantee transmission to Sentry while crashing, it can skip creating a marker file
138-
and making a blocking flush call on the next initialization.
139-
140-
If the marker file exists upon the next SDK initialization, the SDK should clear the marker and block the `init` execution up
141-
to five seconds, in order to flush out pending envelopes. If the timeout of five seconds is exceeded, the SDK should release
142-
the `init` lock and continue flushing on a background thread.
143-
144-
While, ideally, the SDK should only flush out the crash event envelope, it is acceptable to call flush for all envelopes to
145-
reduce the complexity, as most of the time, there shouldn't be too many envelopes in the offline cache.
146-
147-
We decided against making this feature configurable. The only reason to disable it should be if the feature is broken; hence
148-
users can't disable it. The users can't modify the duration for detecting the start-up crashes, which is two seconds, and the
149-
flush duration, which is five seconds, because users usually don't know which values to pick so that we can choose the proper
150-
ones. We can always add these values later.
151-
152-
#### Example implementations
153-
- [Java](https://github.com/getsentry/sentry-java/pull/2277)
154-
- [Objective-C](https://github.com/getsentry/sentry-cocoa/pull/2220)
155-
156-
## HTTP Proxy
157-
158-
Ability to use an HTTP proxy. Often easy to implement using the existing HTTP client. This should be picked up from the system config if possible or explicit config in the client options.
159-
160-
## Attaching Request Body in Server SDKs
161-
162-
Ability for the SDK to attach request body to events and triggered during the execution of request.
163-
164-
User should be able to set a configuration option `maxRequestBodySize` to instruct SDK how big requests bodies should be attached.
165-
SDK controls what is an actual size in bytes for each option:
166-
167-
- `none`
168-
- `small` - `1000` bytes
169-
- `medium` - `10000` bytes (default)
170-
- `always`
171-
172-
## Log context
173-
174-
Some logging frameworks provide an option to set logging context. In Java this is called MDC (Mapped Diagnostic Context).
175-
176-
Users should be able to set a list of logging context entries in a configuration option `contextTags` to tell the SDK to convert the entries to Sentry tags.

develop-docs/sdk/foundations/client/configuration/index.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Core options that all SDKs **MUST** or **SHOULD** support:
5353
| `traces_sample_rate` | `float [0,1]` | Trace/transaction sample rate. |
5454
| `traces_sampler` | `callback` | Dynamic per-transaction sample rate. |
5555
| `trace_propagation_targets` | `array` | URL patterns for outgoing trace header injection. |
56+
| `context_tags` | `array` | List of logging context keys to convert to Sentry tags. See [Log Context](#log-context). |
57+
| `max_request_body_size` | `string` | Controls how large request bodies may be before the SDK skips attaching them. Server SDKs only. See [Request Body Size](#request-body-size). |
5658

5759
</SpecSection>
5860

@@ -176,6 +178,37 @@ ignore_transactions = ['GET /api/health','/api/v1/*']
176178

177179
</SpecSection>
178180

181+
<SpecSection id="request-body-size" status="stable" since="1.0.0">
182+
183+
### Request Body Size
184+
185+
Server SDKs **SHOULD** support attaching the incoming HTTP request body to events. The `max_request_body_size` option controls the maximum body size the SDK will attach. The SDK defines the actual byte thresholds for each setting:
186+
187+
| Value | Max Size |
188+
|---|---|
189+
| `none` | Never attach the body |
190+
| `small` | 1,000 bytes |
191+
| `medium` | 10,000 bytes (default) |
192+
| `always` | No limit |
193+
194+
</SpecSection>
195+
196+
<SpecSection id="log-context" status="stable" since="1.0.0">
197+
198+
### Log Context
199+
200+
Some logging frameworks provide an option to set logging context. In Java this is called MDC (Mapped Diagnostic Context).
201+
202+
SDKs that integrate with platform logging frameworks **SHOULD** support a `context_tags` configuration option. This option accepts a list of logging context keys whose values the SDK converts to Sentry tags on captured events.
203+
204+
```python
205+
sentry_sdk.init(
206+
context_tags=["request_id", "tenant"],
207+
)
208+
```
209+
210+
</SpecSection>
211+
179212
---
180213

181214
## Changelog

0 commit comments

Comments
 (0)