Skip to content
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: 5 additions & 1 deletion bottlecap/src/logs/lambda/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ impl LambdaProcessor {
LambdaProcessor::apply_rules(&self.rules, &mut log.message.message);
if should_send_log {
if let Ok(serialized_log) = serde_json::to_string(&log) {
// explicitly drop log so we don't accidentally re-use it and push
// duplicate logs to the aggregator
drop(log);
to_send.push(serialized_log);
}
}
Expand All @@ -244,7 +247,8 @@ impl LambdaProcessor {
orphan_log.message.lambda.request_id =
Some(self.invocation_context.request_id.clone());
if should_send_log {
if let Ok(serialized_log) = serde_json::to_string(&log) {
if let Ok(serialized_log) = serde_json::to_string(&orphan_log) {
drop(orphan_log);
to_send.push(serialized_log);
}
}
Expand Down