Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

**Breaking Changes**:

- Return status code `413` if a request is rejected due to size limits. ([#5474](https://github.com/getsentry/relay/pull/5474))

## 25.12.1

**Features**:
Expand Down
1 change: 1 addition & 0 deletions relay-server/src/endpoints/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ impl IntoResponse for BadStoreRequest {
// now executed asynchronously in `EnvelopeProcessor`.
(StatusCode::FORBIDDEN, body).into_response()
}
BadStoreRequest::Overflow(_) => (StatusCode::PAYLOAD_TOO_LARGE, body).into_response(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I understand the DACI and docs correctly, Relay will keep emitting outcomes for this, but the SDK will stop doing so?

_ => {
// In all other cases, we indicate a generic bad request to the client and render
// the cause. This was likely the client's fault.
Expand Down
14 changes: 14 additions & 0 deletions tests/integration/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest
import signal
import zlib
from requests import HTTPError


def test_graceful_shutdown_with_in_memory_buffer(mini_sentry, relay):
Expand Down Expand Up @@ -376,3 +377,16 @@ def test_root_project_same(mini_sentry, relay):
same_dsn = mini_sentry.get_dsn_public_key(project_id)
txn = send_transaction_with_dsc(mini_sentry, relay, project_id, same_dsn)
assert txn["contexts"]["trace"]["client_sample_rate"] == 0.5


def test_size_limit_status_code(mini_sentry, relay):
project_id = 42
mini_sentry.add_basic_project_config(project_id)
relay = relay(
mini_sentry,
{
"limits": {"max_event_size": "1B"},
},
)
with pytest.raises(HTTPError, match="413 Client Error"):
relay.send_event(project_id)
Loading