Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: trusted-sync metrics url #363

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/trusted-sync/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
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
Loading