From 3d9b8a9f671a70742a751f8823fd80a09068df06 Mon Sep 17 00:00:00 2001 From: James Bornholt Date: Tue, 21 Nov 2023 09:01:05 -0600 Subject: [PATCH] Use a unique target for request spans (#615) These spans are emitted at a high level (WARN), which is annoying for clients that want to use an adapter to the `log` facade, where `tracing` will emit an event whenever a span is created. To help these clients filter out these span events, let's use a unique target for them. I verified that log messages for requests are still emitting this span metadata when Mountpoint requests log, so this only affects clients that aren't using `tracing`. Signed-off-by: James Bornholt --- mountpoint-s3-client/src/s3_crt_client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mountpoint-s3-client/src/s3_crt_client.rs b/mountpoint-s3-client/src/s3_crt_client.rs index 371071715..65c156d78 100644 --- a/mountpoint-s3-client/src/s3_crt_client.rs +++ b/mountpoint-s3-client/src/s3_crt_client.rs @@ -46,7 +46,7 @@ macro_rules! request_span { // I have confused myself at least 4 times about how to choose the level for tracing spans. // We want this span to be constructed whenever events at WARN or lower severity (INFO, // DEBUG, TRACE) are emitted. So we set its severity to WARN too. - let span = tracing::warn_span!($method, id = counter, $($field)*); + let span = tracing::warn_span!(target: "mountpoint_s3_client::s3_crt_client::request", $method, id = counter, $($field)*); span.in_scope(|| tracing::debug!("new request")); span }};