diff --git a/examples/metrics/src/main.rs b/examples/metrics/src/main.rs index 6b7ad9cedfb..99a9ca66aaf 100644 --- a/examples/metrics/src/main.rs +++ b/examples/metrics/src/main.rs @@ -66,6 +66,13 @@ async fn main() -> Result<(), Box> { loop { match swarm.select_next_some().await { + SwarmEvent::NewListenAddr { address, .. } => { + tracing::info!( + "Local node is listening on\n {}/p2p/{}", + address, + swarm.local_peer_id() + ); + } SwarmEvent::Behaviour(BehaviourEvent::Ping(ping_event)) => { tracing::info!(?ping_event); metrics.record(&ping_event);