diff --git a/src/cmd/src/datanode.rs b/src/cmd/src/datanode.rs index 3a9a3eb6ac91..466514d0387d 100644 --- a/src/cmd/src/datanode.rs +++ b/src/cmd/src/datanode.rs @@ -267,7 +267,7 @@ impl StartCommand { &opts.component.tracing, opts.component.node_id.map(|x| x.to_string()), ); - log_versions(version(), short_version()); + log_versions(version(), short_version(), APP_NAME); info!("Datanode start command: {:#?}", self); info!("Datanode options: {:#?}", opts); diff --git a/src/cmd/src/flownode.rs b/src/cmd/src/flownode.rs index 60ec6c6614c6..e950d9bb43b1 100644 --- a/src/cmd/src/flownode.rs +++ b/src/cmd/src/flownode.rs @@ -215,7 +215,7 @@ impl StartCommand { &opts.component.tracing, opts.component.node_id.map(|x| x.to_string()), ); - log_versions(version(), short_version()); + log_versions(version(), short_version(), APP_NAME); info!("Flownode start command: {:#?}", self); info!("Flownode options: {:#?}", opts); diff --git a/src/cmd/src/frontend.rs b/src/cmd/src/frontend.rs index ae8639f1a000..6d8fd97070ee 100644 --- a/src/cmd/src/frontend.rs +++ b/src/cmd/src/frontend.rs @@ -261,7 +261,7 @@ impl StartCommand { &opts.component.tracing, opts.component.node_id.clone(), ); - log_versions(version(), short_version()); + log_versions(version(), short_version(), APP_NAME); info!("Frontend start command: {:#?}", self); info!("Frontend options: {:#?}", opts); diff --git a/src/cmd/src/lib.rs b/src/cmd/src/lib.rs index f9d61957a0ab..5797ef5a85a5 100644 --- a/src/cmd/src/lib.rs +++ b/src/cmd/src/lib.rs @@ -30,7 +30,7 @@ pub mod standalone; lazy_static::lazy_static! { static ref APP_VERSION: prometheus::IntGaugeVec = - prometheus::register_int_gauge_vec!("greptime_app_version", "app version", &["version", "short_version"]).unwrap(); + prometheus::register_int_gauge_vec!("greptime_app_version", "app version", &["version", "short_version", "app"]).unwrap(); } #[async_trait] @@ -76,10 +76,10 @@ pub trait App: Send { /// Log the versions of the application, and the arguments passed to the cli. /// `version` should be the same as the output of cli "--version"; /// and the `short_version` is the short version of the codes, often consist of git branch and commit. -pub fn log_versions(version: &str, short_version: &str) { +pub fn log_versions(version: &str, short_version: &str, app: &str) { // Report app version as gauge. APP_VERSION - .with_label_values(&[env!("CARGO_PKG_VERSION"), short_version]) + .with_label_values(&[env!("CARGO_PKG_VERSION"), short_version, app]) .inc(); // Log version and argument flags. diff --git a/src/cmd/src/metasrv.rs b/src/cmd/src/metasrv.rs index 44463d063b59..2389770f5231 100644 --- a/src/cmd/src/metasrv.rs +++ b/src/cmd/src/metasrv.rs @@ -244,7 +244,7 @@ impl StartCommand { &opts.component.tracing, None, ); - log_versions(version(), short_version()); + log_versions(version(), short_version(), APP_NAME); info!("Metasrv start command: {:#?}", self); info!("Metasrv options: {:#?}", opts); diff --git a/src/cmd/src/standalone.rs b/src/cmd/src/standalone.rs index efa360713ff9..97899120f9b4 100644 --- a/src/cmd/src/standalone.rs +++ b/src/cmd/src/standalone.rs @@ -415,7 +415,7 @@ impl StartCommand { &opts.component.tracing, None, ); - log_versions(version(), short_version()); + log_versions(version(), short_version(), APP_NAME); info!("Standalone start command: {:#?}", self); info!("Standalone options: {opts:#?}");