From 1a5145592dcc2437d51d2fe0bbf4ffab0ede6081 Mon Sep 17 00:00:00 2001 From: Renato Dinhani Date: Fri, 24 May 2024 19:45:22 -0300 Subject: [PATCH 1/2] fix(subscriber): ignore metadata that is not a span or event (#553) --- console-subscriber/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/console-subscriber/src/lib.rs b/console-subscriber/src/lib.rs index 4d2d822c7..ac1d1ff69 100644 --- a/console-subscriber/src/lib.rs +++ b/console-subscriber/src/lib.rs @@ -529,6 +529,10 @@ where S: Subscriber + for<'a> LookupSpan<'a>, { fn register_callsite(&self, meta: &'static Metadata<'static>) -> subscriber::Interest { + if !meta.is_span() && !meta.is_event() { + return subscriber::Interest::never() + } + let dropped = match (meta.name(), meta.target()) { ("runtime.spawn", _) | ("task", "tokio::task") => { self.spawn_callsites.insert(meta); From e6ecbdf1c8e8c0edee268dc13f1f73da78c870e4 Mon Sep 17 00:00:00 2001 From: Renato Dinhani Date: Mon, 27 May 2024 04:08:27 -0300 Subject: [PATCH 2/2] lint --- console-subscriber/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console-subscriber/src/lib.rs b/console-subscriber/src/lib.rs index ac1d1ff69..fc2552f82 100644 --- a/console-subscriber/src/lib.rs +++ b/console-subscriber/src/lib.rs @@ -530,7 +530,7 @@ where { fn register_callsite(&self, meta: &'static Metadata<'static>) -> subscriber::Interest { if !meta.is_span() && !meta.is_event() { - return subscriber::Interest::never() + return subscriber::Interest::never(); } let dropped = match (meta.name(), meta.target()) {