Skip to content

Commit

Permalink
fix: trusted-sync metrics url (#363)
Browse files Browse the repository at this point in the history
* fix: trusted-sync metrics url

* fix: trusted-sync metrics url
  • Loading branch information
refcell authored Jul 9, 2024
1 parent 22c1570 commit 105b633
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/trusted-sync/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ 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_ADDR: &str = "0.0.0.0";
const DEFAULT_LOKI_SERVER_PORT: u16 = 3100;

/// The host binary CLI application arguments.
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 105b633

Please sign in to comment.