diff --git a/src/cmd_all/src/standalone.rs b/src/cmd_all/src/standalone.rs index 15a46d789ff3d..c0a46f087298c 100644 --- a/src/cmd_all/src/standalone.rs +++ b/src/cmd_all/src/standalone.rs @@ -119,6 +119,9 @@ fn parse_opt_args(opts: &StandaloneOpts) -> ParsedStandaloneOpts { if let Some(compactor_opts) = compactor_opts.as_mut() { 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()); + } } ParsedStandaloneOpts { meta_opts, @@ -224,7 +227,9 @@ mod test { listen_addr: "127.0.0.1:8001", advertise_addr: "127.0.0.1:9999", dashboard_host: None, - prometheus_host: None, + prometheus_host: Some( + "127.0.0.1:1234", + ), etcd_endpoints: "", etcd_auth: false, etcd_username: "", diff --git a/src/meta/node/src/lib.rs b/src/meta/node/src/lib.rs index 4be2bba4039b2..2737c35e68eb2 100644 --- a/src/meta/node/src/lib.rs +++ b/src/meta/node/src/lib.rs @@ -58,7 +58,7 @@ pub struct MetaNodeOpts { dashboard_host: Option, #[clap(long, env = "RW_PROMETHEUS_HOST")] - prometheus_host: Option, + pub prometheus_host: Option, #[clap(long, env = "RW_ETCD_ENDPOINTS", default_value_t = String::from(""))] etcd_endpoints: String,