diff --git a/relay-server/src/actors/processor.rs b/relay-server/src/actors/processor.rs index 2819b37efc..a25d2c1b13 100644 --- a/relay-server/src/actors/processor.rs +++ b/relay-server/src/actors/processor.rs @@ -2364,8 +2364,10 @@ impl EnvelopeProcessorService { ItemAction::Drop(outcome.clone()) } }); + state.managed_envelope.update_freeze_event(); if state.managed_envelope.envelope().is_empty() { - // Just for bookkeeping. + // Call reject to make sure that outcomes are generated for the transaction event, + // which has already been removed from the envelope for processing. state.managed_envelope.reject(outcome); } diff --git a/relay-server/src/utils/managed_envelope.rs b/relay-server/src/utils/managed_envelope.rs index d600bc6232..2df4e70d8c 100644 --- a/relay-server/src/utils/managed_envelope.rs +++ b/relay-server/src/utils/managed_envelope.rs @@ -181,6 +181,21 @@ impl ManagedEnvelope { self } + /// Update the context with envelope information, leaving event information untouched. + /// + /// This is useful when the event has already been removed from the envelope for processing, + /// but we still want outcomes to be generated for the event. + pub fn update_freeze_event(&mut self) -> &mut Self { + let event_category = self.context.summary.event_category; + let event_metrics_extracted = self.context.summary.event_metrics_extracted; + + self.context.summary = EnvelopeSummary::compute(self.envelope()); + + self.context.summary.event_category = event_category; + self.context.summary.event_metrics_extracted = event_metrics_extracted; + self + } + /// Retains or drops items based on the [`ItemAction`]. /// ///