diff --git a/relay-server/src/endpoints/common.rs b/relay-server/src/endpoints/common.rs index a6655cb09e..e4ea3c6953 100644 --- a/relay-server/src/endpoints/common.rs +++ b/relay-server/src/endpoints/common.rs @@ -416,12 +416,35 @@ fn emit_envelope_metrics(envelope: &Envelope) { ); } + // BEGIN temporary if has_transaction && has_attachment { metric!( counter(RelayCounters::TransactionsWithAttachments) += 1, sdk = client_name.name(), - ) + ); + relay_log::with_scope( + |scope| { + // Set the organization as user so we can figure out who uses this. + scope.set_user(Some(relay_log::sentry::User { + id: Some( + envelope + .meta() + .get_partial_scoping() + .organization_id + .to_string(), + ), + ..Default::default() + })); + }, + || { + relay_log::sentry::capture_message( + "transaction with attachment", + relay_log::sentry::Level::Info, + ); + }, + ); } + // END temporary } #[derive(Debug)] diff --git a/tests/integration/fixtures/mini_sentry.py b/tests/integration/fixtures/mini_sentry.py index 1c419b372e..9783e13cc4 100644 --- a/tests/integration/fixtures/mini_sentry.py +++ b/tests/integration/fixtures/mini_sentry.py @@ -305,7 +305,11 @@ def store_internal_error_event(): envelope = Envelope.deserialize(flask_request.data) event = envelope.get_event() - if event is not None and sentry.fail_on_relay_error: + if ( + event is not None + and sentry.fail_on_relay_error + and event.get("level") != "info" + ): error = AssertionError("Relay sent us event: " + get_error_message(event)) sentry.test_failures.put(("/api/666/envelope/", error))