Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(replays): Add InvalidReplay outcome #1455

Merged
merged 4 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions relay-server/src/actors/outcome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,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.
InvalidReplay,
cmanallen marked this conversation as resolved.
Show resolved Hide resolved
}

impl DiscardReason {
Expand Down Expand Up @@ -363,6 +366,7 @@ impl DiscardReason {
DiscardReason::TransactionSampled => "transaction_sampled",
DiscardReason::EmptyEnvelope => "empty_envelope",
DiscardReason::InvalidProfile => "invalid_profile",
DiscardReason::InvalidReplay => "invalid_replay",
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion relay-server/src/actors/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -903,7 +904,11 @@ impl EnvelopeProcessor {
true
}
Err(_) => {
relay_log::debug!("Replay item could not be parsed.");
context.track_outcome(
Outcome::Invalid(DiscardReason::InvalidReplay),
DataCategory::Replay,
1,
);
false
}
}
Expand Down