Skip to content

feat(minidump): Stream Minidumps to objectstore#5909

Open
tobias-wilfert wants to merge 15 commits intomasterfrom
tobias-wilfert/feat/stream-minidumps
Open

feat(minidump): Stream Minidumps to objectstore#5909
tobias-wilfert wants to merge 15 commits intomasterfrom
tobias-wilfert/feat/stream-minidumps

Conversation

@tobias-wilfert
Copy link
Copy Markdown
Member

@tobias-wilfert tobias-wilfert commented Apr 29, 2026

Follow up to #5877. This now also adds the logic for streaming minidumps to the objectstore. Just as for attachments, streaming minidumps is guarded by a feature flag.

Note: This only deals with the "happy path". Streaming compressed minidumps to the object store is not supported, neither is embedded minidumps. Furthermore streaming minidumps means no pii-scrubbing.

Fix: INGEST-871

@tobias-wilfert tobias-wilfert self-assigned this Apr 29, 2026
Comment on lines +502 to 509
pub async fn upload_to_objectstore<S, E>(
stream: S,
content_type: Option<String>,
mut item: Item,
config: &Config,
scoping: Scoping,
upload: &Addr<Upload>,
referrer: &'static str,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think a 'typed stream' would be nice here as a follow up. As in something that bundles the stream, content_type and referrer.


let upload_context = if should_fetch_project_config(&state, meta.project_id()) {
// Ensure that we really make it here.
relay_statsd::metric!(counter(RelayCounters::MinidumpEndpointConfigFetching) += 1);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Left this in for now since it gives us a free insight on how often we get raw_minidumps (will remove when adding the kill switch).

@tobias-wilfert tobias-wilfert changed the title WIP: feat(minidump): Stream Minidumps to objectstore feat(minidump): Stream Minidumps to objectstore Apr 29, 2026
@tobias-wilfert tobias-wilfert requested a review from jjbayer April 29, 2026 12:58
Comment thread relay-server/src/endpoints/minidump.rs Outdated
@tobias-wilfert tobias-wilfert marked this pull request as ready for review April 29, 2026 13:02
@tobias-wilfert tobias-wilfert requested a review from a team as a code owner April 29, 2026 13:02
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 29, 2026

Comment thread relay-server/src/endpoints/minidump.rs
Copy link
Copy Markdown
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

Good stuff!

Comment thread CHANGELOG.md Outdated
Comment thread relay-server/src/endpoints/minidump.rs
Comment thread relay-server/src/endpoints/common.rs Outdated
Comment thread relay-server/src/endpoints/minidump.rs
Comment thread relay-server/src/endpoints/minidump.rs Outdated
Comment thread relay-server/src/endpoints/minidump.rs
Comment thread relay-server/src/endpoints/minidump.rs
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1297179. Configure here.

Comment thread relay-server/src/endpoints/minidump.rs Outdated
Comment on lines +318 to +320
if rate_limits.is_limited() {
return Err(BadStoreRequest::RateLimited(rate_limits));
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The new error quota check in upload_context_for_project can prematurely return a 429 error, bypassing logic that explicitly ignores rate limits for minidump uploads.
Severity: HIGH

Suggested Fix

The error quota check should not reject the request with a BadStoreRequest::RateLimited error. Instead, it should be used to conditionally control whether minidumps are streamed to the object store (e.g., by setting a boolean flag), while still allowing the rest of the minidump processing to complete without returning a 429 error.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: relay-server/src/endpoints/minidump.rs#L318-L320

Potential issue: A new rate limit check in `upload_context_for_project` checks for error
quotas and returns `Err(BadStoreRequest::RateLimited(...))` if a project's quota is
exceeded. In the minidump `handle` function, this error propagates and is converted into
an HTTP 429 response before the envelope is processed. This bypasses the existing
`ignore_rate_limits()` call, which is specifically designed to prevent the minidump
endpoint from ever returning a 429 status, as clients often retry these requests. The
new check breaks this intended behavior.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fair enough.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Talked with Joris and the plan is to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants