Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
tabVersion committed Feb 2, 2024
1 parent 8fdd0ba commit 84c494f
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
95 changes: 95 additions & 0 deletions proto/telemetry.proto
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions src/prost/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
"stream_plan",
"stream_service",
"task_service",
"telemetry",
"user",
];
let protos: Vec<String> = proto_files
Expand Down

0 comments on commit 84c494f

Please sign in to comment.