diff --git a/src/cmd_all/src/standalone.rs b/src/cmd_all/src/standalone.rs index 24b90ad613da4..8765db18a07cd 100644 --- a/src/cmd_all/src/standalone.rs +++ b/src/cmd_all/src/standalone.rs @@ -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()); } } @@ -246,6 +246,7 @@ mod test { // Test parsing into node-level opts. let actual = parse_standalone_opt_args(&opts); + check( actual, expect![[r#" @@ -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: "", diff --git a/src/meta/node/src/lib.rs b/src/meta/node/src/lib.rs index d13c041de6007..25781e73efb97 100644 --- a/src/meta/node/src/lib.rs +++ b/src/meta/node/src/lib.rs @@ -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, + #[clap(long, env = "RW_PROMETHEUS_HOST", alias = "prometheus_host")] + pub prometheus_listener_addr: Option, #[clap(long, env = "RW_ETCD_ENDPOINTS", default_value_t = String::from(""))] etcd_endpoints: String, @@ -200,7 +200,7 @@ pub fn start(opts: MetaNodeOpts) -> Pin + 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