From fecb3a55ffc7c4fb8042954898223b01e6d7412d Mon Sep 17 00:00:00 2001 From: tabVersion Date: Fri, 17 Nov 2023 15:26:16 +0800 Subject: [PATCH] report rw version in telemetry --- src/meta/src/telemetry.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/meta/src/telemetry.rs b/src/meta/src/telemetry.rs index fbbc89c2ff0ec..66ee36bd16d84 100644 --- a/src/meta/src/telemetry.rs +++ b/src/meta/src/telemetry.rs @@ -20,6 +20,7 @@ use risingwave_common::telemetry::{ current_timestamp, SystemData, TelemetryNodeType, TelemetryReport, TelemetryReportBase, TelemetryResult, }; +use risingwave_common::{GIT_SHA, RW_VERSION}; use risingwave_pb::common::WorkerType; use serde::{Deserialize, Serialize}; @@ -34,6 +35,12 @@ struct NodeCount { compactor_count: u64, } +#[derive(Debug, Serialize, Deserialize)] +struct RwVersion { + version: String, + git_sha: String, +} + #[derive(Debug, Serialize, Deserialize)] pub struct MetaTelemetryReport { #[serde(flatten)] @@ -41,6 +48,7 @@ pub struct MetaTelemetryReport { node_count: NodeCount, // At this point, it will always be etcd, but we will enable telemetry when using memory. meta_backend: MetaBackend, + rw_version: RwVersion, } impl TelemetryReport for MetaTelemetryReport {} @@ -88,6 +96,10 @@ impl TelemetryReportCreator for MetaReportCreator { ) -> TelemetryResult { let node_map = self.cluster_mgr.count_worker_node().await; Ok(MetaTelemetryReport { + rw_version: RwVersion { + version: RW_VERSION.to_string(), + git_sha: GIT_SHA.to_string(), + }, base: TelemetryReportBase { tracking_id, session_id,