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: Metrics api #2013

Merged
merged 14 commits into from
Sep 19, 2023
5 changes: 5 additions & 0 deletions dozer-types/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.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()
Expand Down
22 changes: 22 additions & 0 deletions dozer-types/protos/telemetry.proto
Original file line number Diff line number Diff line change
@@ -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; }
6 changes: 6 additions & 0 deletions dozer-types/src/grpc_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Loading