From fe70f9ee979be40cd48b179ac10fcaf32f3dd9de Mon Sep 17 00:00:00 2001 From: Noel Kwan <47273164+kwannoel@users.noreply.github.com> Date: Fri, 3 Nov 2023 16:33:34 +0800 Subject: [PATCH] chore(standalone): pass `prometheus_listener_addr` to meta (#13236) --- src/cmd_all/src/standalone.rs | 7 ++++++- src/meta/node/src/lib.rs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cmd_all/src/standalone.rs b/src/cmd_all/src/standalone.rs index 15a46d789ff3..c0a46f087298 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 4be2bba4039b..2737c35e68eb 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,