Skip to content
Open
Changes from all commits
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
57 changes: 7 additions & 50 deletions relay-server/src/services/processor/replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::services::outcome::DiscardReason;
use crate::services::processor::{ProcessingError, ReplayGroup, should_filter};
use crate::services::projects::project::ProjectInfo;
use crate::statsd::{RelayCounters, RelayTimers};
use crate::utils::sample;

use bytes::Bytes;
use relay_base_schema::organization::OrganizationId;
Expand Down Expand Up @@ -255,55 +254,13 @@ fn handle_replay_recording_item(
})
.map(Into::into)
.map_err(|error| {
match &error {
relay_replays::recording::ParseRecordingError::Compression(e) => {
// 20k errors per day at 0.1% sample rate == 20 logs per day
if sample(0.001).is_keep() {
Copy link
Member

Choose a reason for hiding this comment

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

Is it ok to get rid of this sampling?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here yes, the debug level is meant to be used for messages/errors which can be triggered by user input (e.g. like here by sending a Replay with a broken compression).

relay_log::with_scope(
move |scope| {
scope.add_attachment(relay_log::protocol::Attachment {
buffer: payload.into(),
filename: "payload".to_owned(),
content_type: Some("application/octet-stream".to_owned()),
ty: None,
});
},
|| {
relay_log::error!(
error = e as &dyn Error,
event_id = ?config.event_id,
project_id = config.project_id.map(|v| v.value()),
organization_id = config.organization_id.map(|o| o.value()),
"ParseRecordingError::Compression"
)
},
);
}
}
relay_replays::recording::ParseRecordingError::Message(e) => {
// Only 118 errors in the past 30 days. We log everything.
relay_log::with_scope(
move |scope| {
scope.add_attachment(relay_log::protocol::Attachment {
buffer: payload.into(),
filename: "payload".to_owned(),
content_type: Some("application/octet-stream".to_owned()),
ty: None,
});
},
|| {
relay_log::error!(
error = e,
event_id = ?config.event_id,
project_id = config.project_id.map(|v| v.value()),
organization_id = config.organization_id.map(|o| o.value()),
"ParseRecordingError::Message"
Copy link
Member

Choose a reason for hiding this comment

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

Can we keep the two different types? (message vs compression)

Copy link
Member Author

Choose a reason for hiding this comment

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

The error message is still logged, the differentiation was more necessary before to get different sentry groups.

)
},
);
}
_ => (),
};
relay_log::debug!(
error = &error as &dyn Error,
event_id = ?config.event_id,
project_id = config.project_id.map(|v| v.value()),
organization_id = config.organization_id.map(|o| o.value()),
"invalid replay recording"
);
ProcessingError::InvalidReplay(DiscardReason::InvalidReplayRecordingEvent)
})
}
Expand Down
Loading