Skip to content

Commit 46e9e9c

Browse files
authored
[SVLS-8179] add debug log for flush strategy (#974)
## Overview * Add debug log for flush strategy. * Add debug log for incoming telemetry records. This excludes Extension telemetry since that would lead to an infinite loop. ## Testing * Deployed and invoked function. Confirm we see flush strategy and incoming telemetry records.
1 parent 57315b8 commit 46e9e9c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

bottlecap/src/bin/bottlecap/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ async fn extension_loop_active(
605605

606606
// Validate and get the appropriate flush strategy for the current mode
607607
let flush_strategy = get_flush_strategy_for_mode(&aws_config, config.serverless_flush_strategy);
608+
debug!("Flush strategy: {:?}", flush_strategy);
608609
let mut flush_control = FlushControl::new(flush_strategy, config.flush_timeout);
609610

610611
debug!(

bottlecap/src/logs/lambda/processor.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ impl LambdaProcessor {
8888
#[allow(clippy::too_many_lines)]
8989
async fn get_message(&mut self, event: TelemetryEvent) -> Result<Message, Box<dyn Error>> {
9090
let copy = event.clone();
91+
92+
// Log all non-Extension telemetry events to avoid infinite loop
93+
if !matches!(event.record, TelemetryRecord::Extension(_)) {
94+
debug!("LOGS | Incoming telemetry event: {:?}", event.record);
95+
}
96+
9197
match event.record {
9298
TelemetryRecord::Function(v) => {
9399
let (request_id, message) = match v {

0 commit comments

Comments
 (0)