Skip to content

Commit 4a40151

Browse files
fix: Network failures drop envelope on 429 (#15727)
Clarify that SDKs must also drop envelopes on 429 responses. Co-authored-by: Markus Hintersteiner <[email protected]>
1 parent e4de7d8 commit 4a40151

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,20 @@ Write events to disk before attempting to send, so that they can be retried in t
251251

252252
### Dealing With Network Failures
253253

254-
When SDKs receive an `HTTP 2xx` status code response from Sentry, they **MUST** consider it as a successful send. If Sentry returns an `HTTP 4xx` (excluding `HTTP 429`) or `HTTP 5xx` status code, SDKs **MUST** discard the envelope and record a [client report](/sdk/telemetry/client-reports) with the discard reason `send_error`. For an `HTTP 429` response, SDKs **MUST NOT** record a client report to comply with the [rate limiting](/sdk/expected-features/rate-limiting/) rules, because the backend already records a client report for the rate limit. SDKs **MAY** retry sending the envelope when a network error occurs, such as:
254+
When SDKs receive an `HTTP 2xx` status code response from Sentry, they **MUST** consider it as a successful send.
255+
256+
If Sentry returns an `HTTP 4xx` or `HTTP 5xx` status code, SDKs:
257+
258+
- **MUST** discard the envelope
259+
- **MUST** record a [client report](/sdk/telemetry/client-reports) with the discard reason `send_error`, except for `HTTP 429` responses, see below.
260+
261+
For an `HTTP 429` response, SDKs:
262+
263+
- **MUST** respect the [rate limiting rules](/sdk/expected-features/rate-limiting/), such as correctly parsing the retry-header.
264+
- **MUST** drop the envelope, but **MUST NOT** record a [client report](/sdk/telemetry/client-reports), because the backend already does this. Doing this would double-count dropped envelopes.
265+
- **MUST NOT** retry sending the envelope.
266+
267+
SDKs **MAY** retry sending the envelope when a network error occurs, such as:
255268

256269
* Connection timeout
257270
* DSN resolution failure

0 commit comments

Comments
 (0)