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
3 changes: 3 additions & 0 deletions dozer-types/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ 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")
.compile(&["protos/telemetry.proto"], &["protos"])?;

// Sample service generated for tests and development
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
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);
rpc get_traces(TracesRequest) returns (TracesResponse);
}

message MetricsRequest {
string app_id = 1;
uint32 query_type = 2;
string query = 3;
uint64 start = 4;
mediuminvader marked this conversation as resolved.
Show resolved Hide resolved
uint64 end = 5;
uint32 step = 6;
}

message MetricsResponse { string content = 1; }

message TracesRequest { string app_id = 1; }

message TracesResponse { string content = 1; }
5 changes: 5 additions & 0 deletions dozer-types/src/grpc_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ 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");
}

// To be used in tests
pub mod generated {
pub mod films {
Expand Down