Skip to content

Commit

Permalink
rename prometheus_host->prometheus_listener_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Feb 1, 2024
1 parent 3fc4bb1 commit a9eaa4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/cmd_all/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub fn parse_standalone_opt_args(opts: &StandaloneOpts) -> ParsedStandaloneOpts
compactor_opts.prometheus_listener_addr = prometheus_listener_addr.clone();
}
if let Some(meta_opts) = meta_opts.as_mut() {
meta_opts.prometheus_host = Some(prometheus_listener_addr.clone());
meta_opts.prometheus_listener_addr = Some(prometheus_listener_addr.clone());
}
}

Expand Down Expand Up @@ -246,6 +246,7 @@ mod test {

// Test parsing into node-level opts.
let actual = parse_standalone_opt_args(&opts);

check(
actual,
expect![[r#"
Expand All @@ -257,7 +258,7 @@ mod test {
listen_addr: "127.0.0.1:8001",
advertise_addr: "127.0.0.1:9999",
dashboard_host: None,
prometheus_host: Some(
prometheus_listener_addr: Some(
"127.0.0.1:1234",
),
etcd_endpoints: "",
Expand Down
6 changes: 3 additions & 3 deletions src/meta/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ pub struct MetaNodeOpts {

/// We will start a http server at this address via `MetricsManager`.
/// Then the prometheus instance will poll the metrics from this address.
#[clap(long, env = "RW_PROMETHEUS_HOST")]
pub prometheus_host: Option<String>,
#[clap(long, env = "RW_PROMETHEUS_HOST", alias = "prometheus_host")]
pub prometheus_listener_addr: Option<String>,

#[clap(long, env = "RW_ETCD_ENDPOINTS", default_value_t = String::from(""))]
etcd_endpoints: String,
Expand Down Expand Up @@ -200,7 +200,7 @@ pub fn start(opts: MetaNodeOpts) -> Pin<Box<dyn Future<Output = ()> + Send>> {
info!("> version: {} ({})", RW_VERSION, GIT_SHA);
let listen_addr = opts.listen_addr.parse().unwrap();
let dashboard_addr = opts.dashboard_host.map(|x| x.parse().unwrap());
let prometheus_addr = opts.prometheus_host.map(|x| x.parse().unwrap());
let prometheus_addr = opts.prometheus_listener_addr.map(|x| x.parse().unwrap());
let backend = match config.meta.backend {
MetaBackend::Etcd => MetaStoreBackend::Etcd {
endpoints: opts
Expand Down

0 comments on commit a9eaa4b

Please sign in to comment.