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

feat(open telemetry): report rw version in telemetry #13490

Merged
merged 3 commits into from
Feb 7, 2024
Merged
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
12 changes: 12 additions & 0 deletions src/meta/src/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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};
use thiserror_ext::AsReport;
Expand All @@ -33,13 +34,20 @@ 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)]
base: TelemetryReportBase,
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 {}
Expand Down Expand Up @@ -92,6 +100,10 @@ impl TelemetryReportCreator for MetaReportCreator {
.map_err(|err| err.as_report().to_string())?;

Ok(MetaTelemetryReport {
rw_version: RwVersion {
version: RW_VERSION.to_string(),
git_sha: GIT_SHA.to_string(),
},
base: TelemetryReportBase {
tracking_id,
session_id,
Expand Down
Loading