From 0ad201fac9040b97e8bd972741b797be3f79526c Mon Sep 17 00:00:00 2001 From: refcell Date: Tue, 9 Jul 2024 10:31:57 -0500 Subject: [PATCH 1/2] fix: trusted-sync metrics url --- examples/trusted-sync/src/cli.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/trusted-sync/src/cli.rs b/examples/trusted-sync/src/cli.rs index 3230894d0..1e9d7ed88 100644 --- a/examples/trusted-sync/src/cli.rs +++ b/examples/trusted-sync/src/cli.rs @@ -7,7 +7,8 @@ use reqwest::Url; const L1_RPC_URL: &str = "L1_RPC_URL"; const L2_RPC_URL: &str = "L2_RPC_URL"; const BEACON_URL: &str = "BEACON_URL"; -const DEFAULT_METRICS_SERVER_ADDR: &str = "127.0.0.1"; +const METRICS_URL: &str = "METRICS_URL"; +const DEFAULT_METRICS_SERVER_ADDR: &str = "0.0.0.0"; const DEFAULT_METRICS_SERVER_PORT: u16 = 9000; const DEFAULT_LOKI_SERVER_ADDR: &str = "127.0.0.1"; const DEFAULT_LOKI_SERVER_PORT: u16 = 3100; @@ -50,6 +51,9 @@ impl Cli { if let Some(url) = self.metrics_url.clone() { return url; } + if let Ok(url) = std::env::var(METRICS_URL) { + return url; + } format!("{}:{}", DEFAULT_METRICS_SERVER_ADDR, DEFAULT_METRICS_SERVER_PORT) } From 713d772497eb7262d6b890b201004915528a09f9 Mon Sep 17 00:00:00 2001 From: refcell Date: Tue, 9 Jul 2024 11:01:16 -0500 Subject: [PATCH 2/2] fix: trusted-sync metrics url --- examples/trusted-sync/src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/trusted-sync/src/cli.rs b/examples/trusted-sync/src/cli.rs index 1e9d7ed88..ed2dc495f 100644 --- a/examples/trusted-sync/src/cli.rs +++ b/examples/trusted-sync/src/cli.rs @@ -10,7 +10,7 @@ const BEACON_URL: &str = "BEACON_URL"; const METRICS_URL: &str = "METRICS_URL"; const DEFAULT_METRICS_SERVER_ADDR: &str = "0.0.0.0"; const DEFAULT_METRICS_SERVER_PORT: u16 = 9000; -const DEFAULT_LOKI_SERVER_ADDR: &str = "127.0.0.1"; +const DEFAULT_LOKI_SERVER_ADDR: &str = "0.0.0.0"; const DEFAULT_LOKI_SERVER_PORT: u16 = 3100; /// The host binary CLI application arguments.