diff --git a/proto/telemetry.proto b/proto/telemetry.proto new file mode 100644 index 0000000000000..017a55d3ccfc0 --- /dev/null +++ b/proto/telemetry.proto @@ -0,0 +1,95 @@ +syntax = "proto3"; + +package telemetry; + +enum MetaBackend { + MetaBackendUnspecified = 0; + MetaBackendMemory = 1; + MetaBackendEtcd = 2; + MetaBackendRdb = 3; +} + +enum TelemetryNodeType { + TelemetryNodeTypeUnspecified = 0; + TelemetryNodeTypeMeta = 1; + TelemetryNodeTypeCompute = 2; + TelemetryNodeTypeFrontend = 3; + TelemetryNodeTypeCompactor = 4; +} + +message SystemMemory { + uint64 used = 1; + uint64 total = 2; +} + +message SystemOs { + string name = 1; + string version = 2; + string kernel_version = 3; +} + +message SystemCpu { + float available = 1; +} + +message SystemData { + SystemMemory memory = 1; + SystemOs os = 2; + SystemCpu cpu = 3; +} + +// NodeCount represents how many nodes in this cluster +message NodeCount { + uint32 meta = 1; + uint32 compute = 2; + uint32 frontend = 3; + uint32 compactor = 4; +} + +// RwVersion represents the version of RisingWave +message RwVersion { + // Version is the Cargo package version of RisingWave + string rw_version = 1; + // GitSHA is the Git commit SHA of RisingWave + string git_sha = 2; +} + +message ReportBase { + // tracking_id is persistent in meta data + string tracking_id = 1; + // session_id is reset every time node restarts + string session_id = 2; + // system_data is hardware and os info + SystemData system_data = 3; + // up_time is how long the node has been running + uint64 up_time = 4; + // report_time is when the report is created + uint64 report_time = 5; + // node_type is the node that creates the report + TelemetryNodeType node_type = 6; +} + +message MetaReport { + ReportBase base = 1; + // meta_backend is the backend of meta data + MetaBackend meta_backend = 2; + // node_count is the count of each node type + NodeCount node_count = 3; + // rw_version is the version of RisingWave + RwVersion rw_version = 4; + // This field represents the "number of running streaming jobs" + // and is used to indicate whether the cluster is active. + uint32 stream_job_count = 5; +} + +message ComputeReport { + ReportBase base = 1; +} + +message FrontendReport { + ReportBase base = 1; +} + +message CompactorReport { + ReportBase base = 1; +} diff --git a/src/prost/build.rs b/src/prost/build.rs index 3af4c9873863d..cd65b20d6f192 100644 --- a/src/prost/build.rs +++ b/src/prost/build.rs @@ -51,6 +51,7 @@ fn main() -> Result<(), Box> { "stream_plan", "stream_service", "task_service", + "telemetry", "user", ]; let protos: Vec = proto_files