diff --git a/dozer-types/build.rs b/dozer-types/build.rs index ccb4328f3f..99d5fa6416 100644 --- a/dozer-types/build.rs +++ b/dozer-types/build.rs @@ -30,10 +30,15 @@ fn main() -> Result<(), Box> { .protoc_arg("--experimental_allow_proto3_optional") .file_descriptor_set_path(out_dir.join("live.bin")) .compile(&["protos/live.proto"], &["protos"])?; + tonic_build::configure() + .protoc_arg("--experimental_allow_proto3_optional") + .file_descriptor_set_path(out_dir.join("telemetry.bin")) + .compile(&["protos/telemetry.proto"], &["protos"])?; tonic_build::configure() .protoc_arg("--experimental_allow_proto3_optional") .file_descriptor_set_path(out_dir.join("api_explorer.bin")) .compile(&["protos/api_explorer.proto"], &["protos"])?; + // Sample service generated for tests and development let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); tonic_build::configure() diff --git a/dozer-types/protos/telemetry.proto b/dozer-types/protos/telemetry.proto new file mode 100644 index 0000000000..ce8291d5c3 --- /dev/null +++ b/dozer-types/protos/telemetry.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package dozer.telemetry; + +service TelemetryService { + rpc get_metrics(MetricsRequest) returns (MetricsResponse); +} + +enum QueryType { + QUERY = 0; + RANGE = 1; +} + +message MetricsRequest { + string app_id = 1; + QueryType query_type = 2; + string query = 3; + optional uint64 start = 4; + optional uint64 end = 5; + optional uint32 step = 6; +} + +message MetricsResponse { string content = 1; } diff --git a/dozer-types/src/grpc_types.rs b/dozer-types/src/grpc_types.rs index bb3bc0277e..785bf39d33 100644 --- a/dozer-types/src/grpc_types.rs +++ b/dozer-types/src/grpc_types.rs @@ -55,6 +55,12 @@ pub mod live { pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("live"); } +pub mod telemetry { + #![allow(clippy::derive_partial_eq_without_eq)] + tonic::include_proto!("dozer.telemetry"); + pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("telemetry"); +} + pub mod api_explorer { #![allow(clippy::derive_partial_eq_without_eq)] tonic::include_proto!("dozer.api_explorer");