Skip to content

Commit

Permalink
hopefully fix encoding regression
Browse files Browse the repository at this point in the history
  • Loading branch information
neuronull committed Aug 10, 2023
1 parent a496821 commit 44c99b3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/sinks/http/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@ impl HttpEncoder {
impl SinkEncoder<Vec<Event>> for HttpEncoder {
fn encode_input(
&self,
mut input: Vec<Event>,
events: Vec<Event>,
writer: &mut dyn io::Write,
) -> io::Result<(usize, GroupedCountByteSize)> {
let mut encoder = self.encoder.clone();
let mut byte_size = telemetry().create_request_count_byte_size();
let mut body = BytesMut::new();

for event in input.iter_mut() {
self.transformer.transform(event);
byte_size.add_event(event, event.estimated_json_encoded_size_of());
}
for mut event in events {
self.transformer.transform(&mut event);

byte_size.add_event(&event, event.estimated_json_encoded_size_of());

for event in input.into_iter() {
encoder
.encode(event, &mut body)
.map_err(|_| io::Error::new(io::ErrorKind::Other, "unable to encode event"))?;
Expand Down

0 comments on commit 44c99b3

Please sign in to comment.