From d5a68224a54d44be417a0c0869a872154cfd531c Mon Sep 17 00:00:00 2001 From: Troy Benson Date: Sun, 5 May 2024 18:02:17 +0000 Subject: [PATCH] fix: tracing init --- foundations/src/telemetry/settings.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/foundations/src/telemetry/settings.rs b/foundations/src/telemetry/settings.rs index d4339fbe7..1f10a0a76 100644 --- a/foundations/src/telemetry/settings.rs +++ b/foundations/src/telemetry/settings.rs @@ -447,7 +447,12 @@ pub async fn init(info: crate::ServiceInfo, settings: TelemetrySettings) { use tracing_subscriber::prelude::*; - tracing_subscriber::registry().with(logging).with(opentelemetry).init(); + let registry = tracing_subscriber::registry(); + #[cfg(feature = "opentelemetry")] + let registry = registry.with(opentelemetry); + #[cfg(feature = "logging")] + let registry = registry.with(logging); + registry.init(); } #[cfg(all(