From bb116ddd8d4d7f91a87b75c72de0299192ff13b3 Mon Sep 17 00:00:00 2001 From: Nicolas Buffon Date: Thu, 24 Oct 2024 09:01:33 +0200 Subject: [PATCH] rust: allow telemetry tracing in copycat example Message reception and emission are automatically traced by the SDK if the feature is enabled This can now be tested using the copycat example by initializing the tracer in the example Signed-off-by: Nicolas Buffon --- rust/examples/copycat.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rust/examples/copycat.rs b/rust/examples/copycat.rs index 67303e48..28bbd17e 100644 --- a/rust/examples/copycat.rs +++ b/rust/examples/copycat.rs @@ -30,6 +30,9 @@ use libits::transport::packet::Packet; use log::{debug, info, warn}; use timer::MessageTimer; +#[cfg(feature = "telemetry")] +use libits::transport::telemetry::init_tracer; + pub struct CopyCat { configuration: Arc, item_receiver: Receiver>, @@ -233,6 +236,9 @@ async fn main() { .set_credentials(username, password.unwrap_or(&String::new())); } + #[cfg(feature = "telemetry")] + init_tracer(&configuration.telemetry, "copycat").expect("Failed to init telemetry"); + pipeline::run::( Arc::new(configuration), Arc::new(RwLock::new(context)),