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

refactor: rename prometheus_host to prometheus_listener_addr #14919

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
2 changes: 2 additions & 0 deletions src/compute/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ pub struct ComputeNodeOpts {
#[clap(long, env = "RW_ADVERTISE_ADDR")]
pub advertise_addr: Option<String>,

/// 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_LISTENER_ADDR",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use futures_async_stream::try_stream;
use opendal::Operator;
use risingwave_common::array::StreamChunk;
use risingwave_common::error::RwError;
use risingwave_pb::meta::table_fragments::fragment;
use tokio::io::BufReader;
use tokio_util::io::{ReaderStream, StreamReader};

Expand All @@ -29,7 +28,7 @@ use crate::parser::{ByteStreamSourceParserImpl, ParserConfig};
use crate::source::filesystem::nd_streaming::need_nd_streaming;
use crate::source::filesystem::{nd_streaming, OpendalFsSplit};
use crate::source::{
self, BoxChunkSourceStream, Column, SourceContextRef, SourceMessage, SourceMeta, SplitMetaData,
BoxChunkSourceStream, Column, SourceContextRef, SourceMessage, SourceMeta, SplitMetaData,
SplitReader,
};

Expand Down
4 changes: 1 addition & 3 deletions src/connector/src/source/filesystem/s3/source/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ use crate::source::filesystem::file_common::FsSplit;
use crate::source::filesystem::nd_streaming;
use crate::source::filesystem::nd_streaming::need_nd_streaming;
use crate::source::filesystem::s3::S3Properties;
use crate::source::{
self, BoxChunkSourceStream, Column, SourceContextRef, SourceMessage, SourceMeta,
};
use crate::source::{BoxChunkSourceStream, Column, SourceContextRef, SourceMessage, SourceMeta};

const MAX_CHANNEL_BUFFER_SIZE: usize = 2048;
const STREAM_READER_CAPACITY: usize = 4096;
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ pub struct FrontendOpts {
#[clap(long, env = "RW_META_ADDR", default_value = "http://127.0.0.1:5690")]
pub meta_addr: MetaAddressStrategy,

/// 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_LISTENER_ADDR",
Expand Down
12 changes: 8 additions & 4 deletions src/meta/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ pub struct MetaNodeOpts {
#[clap(long, env = "RW_DASHBOARD_HOST")]
dashboard_host: Option<String>,

#[clap(long, env = "RW_PROMETHEUS_HOST")]
pub prometheus_host: Option<String>,
/// 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", alias = "prometheus-host")]
pub prometheus_listener_addr: Option<String>,

#[clap(long, env = "RW_ETCD_ENDPOINTS", default_value_t = String::from(""))]
etcd_endpoints: String,
Expand All @@ -84,7 +86,9 @@ pub struct MetaNodeOpts {
#[clap(long, env = "RW_DASHBOARD_UI_PATH")]
dashboard_ui_path: Option<String>,

/// For dashboard service to fetch cluster info.
/// The HTTP REST-API address of the Prometheus instance associated to this cluster.
/// This address is used to serve PromQL queries to Prometheus.
/// It is also used by Grafana Dashboard Service to fetch metrics and visualize them.
#[clap(long, env = "RW_PROMETHEUS_ENDPOINT")]
prometheus_endpoint: Option<String>,

Expand Down Expand Up @@ -196,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
2 changes: 2 additions & 0 deletions src/storage/compactor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pub struct CompactorOpts {
#[clap(long, env = "RW_PORT")]
pub port: Option<u16>,

/// 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_LISTENER_ADDR",
Expand Down
Loading