From cfb7bdcfd8d57e2a949fd900615bbaf75b4ea0dd Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Sun, 22 Dec 2024 16:35:07 +0800 Subject: [PATCH 1/3] Update prometheus binding failure logging format The output of `{:#?}` for the error details is a bit of annoying, this change makes a more consistent formatting style for error messages. --- substrate/utils/prometheus/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/utils/prometheus/src/lib.rs b/substrate/utils/prometheus/src/lib.rs index 5edac2e6650f..843d82dcfad5 100644 --- a/substrate/utils/prometheus/src/lib.rs +++ b/substrate/utils/prometheus/src/lib.rs @@ -87,7 +87,7 @@ async fn request_metrics( /// to serve metrics. pub async fn init_prometheus(prometheus_addr: SocketAddr, registry: Registry) -> Result<(), Error> { let listener = tokio::net::TcpListener::bind(&prometheus_addr).await.map_err(|e| { - log::error!(target: "prometheus", "Error binding to '{:#?}': {:#?}", prometheus_addr, e); + log::error!(target: "prometheus", "Error binding to '{:?}': {:?}", prometheus_addr, e); Error::PortInUse(prometheus_addr) })?; From 7d0dffa0e91777a2000174a0d7e9dc837580c48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Sun, 22 Dec 2024 22:40:14 +0100 Subject: [PATCH 2/3] Update substrate/utils/prometheus/src/lib.rs --- substrate/utils/prometheus/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/utils/prometheus/src/lib.rs b/substrate/utils/prometheus/src/lib.rs index 843d82dcfad5..ae39cb4a7dd3 100644 --- a/substrate/utils/prometheus/src/lib.rs +++ b/substrate/utils/prometheus/src/lib.rs @@ -87,7 +87,7 @@ async fn request_metrics( /// to serve metrics. pub async fn init_prometheus(prometheus_addr: SocketAddr, registry: Registry) -> Result<(), Error> { let listener = tokio::net::TcpListener::bind(&prometheus_addr).await.map_err(|e| { - log::error!(target: "prometheus", "Error binding to '{:?}': {:?}", prometheus_addr, e); + log::error!(target: "prometheus", "Error binding to '{prometheus_addr:?}': {e:?}"); Error::PortInUse(prometheus_addr) })?; From a2f3e409866fac1ae2b06aa9b804e7d38e8048dd Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Sun, 22 Dec 2024 21:41:43 +0000 Subject: [PATCH 3/3] Update from bkchr running command 'prdoc --audience node_dev --bump patch' --- prdoc/pr_6979.prdoc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 prdoc/pr_6979.prdoc diff --git a/prdoc/pr_6979.prdoc b/prdoc/pr_6979.prdoc new file mode 100644 index 000000000000..fae7feeec2df --- /dev/null +++ b/prdoc/pr_6979.prdoc @@ -0,0 +1,8 @@ +title: Update prometheus binding failure logging format +doc: +- audience: Node Dev + description: |- + Using `{:#?}` for the error details is a bit annoying, this change makes a more consistent formatting style for error messages. +crates: +- name: substrate-prometheus-endpoint + bump: patch