From 0b556c4405255add59febdfb0c308d9200d17831 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Sun, 22 Nov 2020 03:39:13 +0000 Subject: [PATCH] Fix metrics http server error messages (#1946) ## Issue Addressed - Resolves #1945 ## Proposed Changes - As per #1945, fix a log message from the metrics server that was falsely claiming to be from the api server. - Ensure successful api request logs are published to debug, not trace. This is something I've wanted to do for a while. ## Additional Info NA --- beacon_node/client/src/builder.rs | 4 ++-- beacon_node/http_api/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon_node/client/src/builder.rs b/beacon_node/client/src/builder.rs index 58485d9787..e4d8561596 100644 --- a/beacon_node/client/src/builder.rs +++ b/beacon_node/client/src/builder.rs @@ -430,11 +430,11 @@ where let exit = runtime_context.executor.exit(); let (listen_addr, server) = http_metrics::serve(ctx, exit) - .map_err(|e| format!("Unable to start HTTP API server: {:?}", e))?; + .map_err(|e| format!("Unable to start HTTP metrics server: {:?}", e))?; runtime_context .executor - .spawn_without_exit(async move { server.await }, "http-api"); + .spawn_without_exit(async move { server.await }, "http-metrics"); Some(listen_addr) } else { diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index a731c7cbb4..22e6ae2d06 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -26,7 +26,7 @@ use lighthouse_version::version_with_platform; use network::NetworkMessage; use parking_lot::Mutex; use serde::{Deserialize, Serialize}; -use slog::{crit, error, info, trace, warn, Logger}; +use slog::{crit, debug, error, info, warn, Logger}; use slot_clock::SlotClock; use ssz::Encode; use state_id::StateId; @@ -116,7 +116,7 @@ pub fn slog_logging( || status == StatusCode::NOT_FOUND || status == StatusCode::PARTIAL_CONTENT => { - trace!( + debug!( log, "Processed HTTP API request"; "elapsed" => format!("{:?}", info.elapsed()),