Skip to content

Commit

Permalink
rust: allow telemetry tracing in copycat example
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nbuffon committed Oct 24, 2024
1 parent 637f3d2 commit 9380cae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rust/examples/copycat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Configuration>,
item_receiver: Receiver<Packet<GeoTopic, Exchange>>,
Expand Down Expand Up @@ -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::<CopyCat, NoContext, GeoTopic>(
Arc::new(configuration),
Arc::new(RwLock::new(context)),
Expand Down

0 comments on commit 9380cae

Please sign in to comment.