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

Revert "add option to print full payload on invalid message (#5979)" #5981

Merged
merged 1 commit into from
May 30, 2024
Merged
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
6 changes: 1 addition & 5 deletions rust_snuba/src/processors/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use rust_arroyo::backends::kafka::types::KafkaPayload;

use crate::config::ProcessorConfig;
use crate::processors::utils::{enforce_retention, StringToIntDatetime};
use crate::runtime_config::get_str_config;
use crate::types::{
InsertBatch, InsertOrReplacement, KafkaMessageMetadata, ReplacementData, RowData,
};
Expand All @@ -39,10 +38,7 @@ pub fn process_message_with_replacement(
let four = from_slice(payload_bytes).map(|_: FourTrain| ());
let three = from_slice(payload_bytes).map(|_: ThreeTrain| ());

let format_full_invalid_payload = get_str_config("errors_format_full_invalid_payload").map_or(false, |o| o.map_or(false, |v| v.as_str() == "true"));

format!("payload start: {}\n\nerror trying to deserialize as event: {:?}\n\nerror trying to deserialize as replacement: {:?}",
if format_full_invalid_payload {String::from_utf8_lossy(payload_bytes)} else {String::from_utf8_lossy(&payload_bytes[..50])}, four, three)
format!("payload start: {}\n\nerror trying to deserialize as event: {:?}\n\nerror trying to deserialize as replacement: {:?}", String::from_utf8_lossy(&payload_bytes[..50]), four, three)
})?;

let (version, msg_type, error_event, replacement_event) = match msg {
Expand Down
Loading