diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c5b1d1c3d..b041421a64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Batch metrics buckets into logical partitions before sending them as envelopes. ([#1440](https://github.com/getsentry/relay/pull/1440)) - Filter single samples in cocoa profiles and events with no duration in Android profiles. ([#1445](https://github.com/getsentry/relay/pull/1445)) - Add looser type requirements for the user.id field. ([#1443](https://github.com/getsentry/relay/pull/1443)) +- Add InvalidReplayEvent outcome. ([#1455](https://github.com/getsentry/relay/pull/1455)) - Add replay and replay-recording rate limiter. ([#1456](https://github.com/getsentry/relay/pull/1456)) **Features**: diff --git a/relay-server/src/actors/outcome.rs b/relay-server/src/actors/outcome.rs index 452d278c67..9004ce836f 100644 --- a/relay-server/src/actors/outcome.rs +++ b/relay-server/src/actors/outcome.rs @@ -324,6 +324,9 @@ pub enum DiscardReason { /// (Relay) The profile is parseable but semantically invalid. This could happen if /// profiles lack sufficient samples. InvalidProfile, + + // (Relay) We failed to parse the replay so we discard it. + InvalidReplayEvent, } impl DiscardReason { @@ -361,6 +364,7 @@ impl DiscardReason { DiscardReason::TransactionSampled => "transaction_sampled", DiscardReason::EmptyEnvelope => "empty_envelope", DiscardReason::InvalidProfile => "invalid_profile", + DiscardReason::InvalidReplayEvent => "invalid_replay", } } } diff --git a/relay-server/src/actors/processor.rs b/relay-server/src/actors/processor.rs index 4840d122b6..35fb1da87f 100644 --- a/relay-server/src/actors/processor.rs +++ b/relay-server/src/actors/processor.rs @@ -886,6 +886,7 @@ impl EnvelopeProcessor { /// Remove replays if the feature flag is not enabled fn process_replays(&self, state: &mut ProcessEnvelopeState) { let replays_enabled = state.project_state.has_feature(Feature::Replays); + let context = &state.envelope_context; let envelope = &mut state.envelope; let client_addr = envelope.meta().client_addr(); @@ -903,7 +904,11 @@ impl EnvelopeProcessor { true } Err(_) => { - relay_log::debug!("Replay item could not be parsed."); + context.track_outcome( + Outcome::Invalid(DiscardReason::InvalidReplayEvent), + DataCategory::Replay, + 1, + ); false } }