From f5643c2533fbf7f0caa286d13af00d7048715f8b Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 26 Oct 2026 21:05:26 -0400 Subject: [PATCH] test(relay): capture access logs with the production JSON formatter The capture helpers built a generic flattened JSON layer, which could drift from the TraceContextJson formatter main.rs installs. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- crates/buzz-relay/src/access.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/buzz-relay/src/access.rs b/crates/buzz-relay/src/access.rs index 1412785e9c..42717fef36 100644 --- a/crates/buzz-relay/src/access.rs +++ b/crates/buzz-relay/src/access.rs @@ -1302,7 +1302,7 @@ pub(crate) mod tests { tracing_subscriber::registry().with( tracing_subscriber::fmt::layer() .json() - .flatten_event(true) + .event_format(crate::telemetry::TraceContextLookup::default().json_formatter(false)) .with_writer(move || writer.clone()), ) } @@ -1317,7 +1317,7 @@ pub(crate) mod tests { (r, out) } - /// Run `f` with JSON logs (flattened, as in production) captured. + /// Run `f` with JSON logs captured, using production's JSON formatter. pub(crate) fn capture(f: impl FnOnce() -> R) -> (R, Captured) { let _lock = crate::test_support::tracing_dispatch_lock(); let out = Captured::default();