-
Notifications
You must be signed in to change notification settings - Fork 104
ref(instr): Lower logging level for replay errors #5455
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -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() { | ||
| 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" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we keep the two different types? (message vs compression)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
| }) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).