From 2a595238bea2bb8fd72eec5a36b6b2863c4eedeb Mon Sep 17 00:00:00 2001 From: Jordan Gonzalez <30836115+duncanista@users.noreply.github.com> Date: Tue, 3 Mar 2026 14:50:06 +0100 Subject: [PATCH 1/2] fix `level` to `status` --- bottlecap/Cargo.lock | 2 +- bottlecap/src/lifecycle/invocation/processor.rs | 5 ++++- bottlecap/src/logger.rs | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bottlecap/Cargo.lock b/bottlecap/Cargo.lock index 41a6272da..bb6f5d25d 100644 --- a/bottlecap/Cargo.lock +++ b/bottlecap/Cargo.lock @@ -525,7 +525,7 @@ dependencies = [ "tokio", "tokio-util", "tonic-types", - "tower 0.5.3", + "tower", "tower-http", "tracing", "tracing-core", diff --git a/bottlecap/src/lifecycle/invocation/processor.rs b/bottlecap/src/lifecycle/invocation/processor.rs index ccb9f497e..e369e5238 100644 --- a/bottlecap/src/lifecycle/invocation/processor.rs +++ b/bottlecap/src/lifecycle/invocation/processor.rs @@ -285,7 +285,10 @@ impl Processor { /// This is used to create a cold start span, since this telemetry event does not /// provide a `request_id`, we try to guess which invocation is the cold start. pub fn on_platform_init_start(&mut self, time: DateTime, runtime_version: Option) { - if runtime_version.as_deref().map_or(false, |rv| rv.contains("DurableFunction")) { + if runtime_version + .as_deref() + .is_some_and(|rv| rv.contains("DurableFunction")) + { self.enhanced_metrics.set_durable_function_tag(); } let start_time: i64 = SystemTime::from(time) diff --git a/bottlecap/src/logger.rs b/bottlecap/src/logger.rs index 56079b90b..18f43f653 100644 --- a/bottlecap/src/logger.rs +++ b/bottlecap/src/logger.rs @@ -79,7 +79,7 @@ where let message = format!("DD_EXTENSION | {level} | {span_prefix}{}", visitor.0); - write!(writer, "{{\"level\":\"{level}\",\"message\":\"")?; + write!(writer, "{{\"status\":\"{level}\",\"message\":\"")?; write_json_escaped(&mut writer, &message)?; writeln!(writer, "\"}}") } @@ -187,7 +187,7 @@ mod tests { let parsed: serde_json::Value = serde_json::from_str(output.trim()).expect("output should be valid JSON"); - assert_eq!(parsed["level"], "INFO"); + assert_eq!(parsed["status"], "INFO"); assert!( parsed["message"] .as_str() @@ -204,7 +204,7 @@ mod tests { let parsed: serde_json::Value = serde_json::from_str(output.trim()).expect("output should be valid JSON"); - assert_eq!(parsed["level"], "ERROR"); + assert_eq!(parsed["status"], "ERROR"); assert!( parsed["message"] .as_str() @@ -221,7 +221,7 @@ mod tests { let parsed: serde_json::Value = serde_json::from_str(output.trim()).expect("output should be valid JSON"); - assert_eq!(parsed["level"], "DEBUG"); + assert_eq!(parsed["status"], "DEBUG"); assert!( parsed["message"] .as_str() From c77ae7f096baaec1cc14ec0a6aaff56c1b16b056 Mon Sep 17 00:00:00 2001 From: Jordan Gonzalez <30836115+duncanista@users.noreply.github.com> Date: Tue, 3 Mar 2026 14:53:45 +0100 Subject: [PATCH 2/2] add comment about change --- bottlecap/src/logger.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bottlecap/src/logger.rs b/bottlecap/src/logger.rs index 18f43f653..b9a828fc7 100644 --- a/bottlecap/src/logger.rs +++ b/bottlecap/src/logger.rs @@ -79,6 +79,9 @@ where let message = format!("DD_EXTENSION | {level} | {span_prefix}{}", visitor.0); + // Setting specifically `status` as opposed to `level` since AWS + // filters out logs by the `level` field. This allows our logs to + // appear in CWL regardless of the log level. write!(writer, "{{\"status\":\"{level}\",\"message\":\"")?; write_json_escaped(&mut writer, &message)?; writeln!(writer, "\"}}")