Print endpoint addresses at startup (#867)

* print tracing and metrics endpoints in startup

* print network address in startup
This commit is contained in:
Alfredo Garcia 2020-08-10 16:47:26 -03:00 committed by GitHub
parent f8a24f9c11
commit 9c387521bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -191,6 +191,8 @@ where
S::Future: Send + 'static, S::Future: Send + 'static,
{ {
let mut listener = TcpListener::bind(addr).await?; let mut listener = TcpListener::bind(addr).await?;
let local_addr = listener.local_addr()?;
info!("Network listening at {}", local_addr);
loop { loop {
if let Ok((tcp_stream, addr)) = listener.accept().await { if let Ok((tcp_stream, addr)) = listener.accept().await {
debug!(?addr, "got incoming connection"); debug!(?addr, "got incoming connection");

View File

@ -30,7 +30,7 @@ impl MetricsEndpoint {
return Ok(()); return Ok(());
}; };
info!("Initializing metrics endpoint"); info!("Initializing metrics endpoint at {}", addr);
// XXX do we need to hold on to the receiver? // XXX do we need to hold on to the receiver?
let receiver = Receiver::builder() let receiver = Receiver::builder()

View File

@ -41,7 +41,7 @@ impl TracingEndpoint {
} else { } else {
return Ok(()); return Ok(());
}; };
info!("Initializing tracing endpoint"); info!("Initializing tracing endpoint at {}", addr);
let service = let service =
make_service_fn(|_| async { Ok::<_, hyper::Error>(service_fn(request_handler)) }); make_service_fn(|_| async { Ok::<_, hyper::Error>(service_fn(request_handler)) });