From f56cb84ef15fbeb3a5a74f4a4ab3286a09e36237 Mon Sep 17 00:00:00 2001 From: Dario Pizzamiglio Date: Mon, 11 Sep 2023 11:16:14 +0800 Subject: [PATCH 1/7] Add telemetry api --- dozer-types/build.rs | 3 +++ dozer-types/protos/telemetry.proto | 18 ++++++++++++++++++ dozer-types/src/grpc_types.rs | 5 +++++ 3 files changed, 26 insertions(+) create mode 100644 dozer-types/protos/telemetry.proto diff --git a/dozer-types/build.rs b/dozer-types/build.rs index 4f6bd7141d..e4a3231577 100644 --- a/dozer-types/build.rs +++ b/dozer-types/build.rs @@ -30,6 +30,9 @@ 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") + .compile(&["protos/telemetry.proto"], &["protos"])?; // Sample service generated for tests and development let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); diff --git a/dozer-types/protos/telemetry.proto b/dozer-types/protos/telemetry.proto new file mode 100644 index 0000000000..0164eddf3a --- /dev/null +++ b/dozer-types/protos/telemetry.proto @@ -0,0 +1,18 @@ +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; + string query = 2; +} + +message MetricsResponse { string content = 1; } + +message TracesRequest { string app_id = 1; } + +message TracesResponse { string content = 1; } \ No newline at end of file diff --git a/dozer-types/src/grpc_types.rs b/dozer-types/src/grpc_types.rs index 1b5274cc90..ebd9cb7d40 100644 --- a/dozer-types/src/grpc_types.rs +++ b/dozer-types/src/grpc_types.rs @@ -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 { From cc7cd7632027eff65d722be0d13e70b579305a2c Mon Sep 17 00:00:00 2001 From: Dario Pizzamiglio Date: Wed, 13 Sep 2023 16:24:53 +0800 Subject: [PATCH 2/7] add range parameters --- dozer-types/protos/telemetry.proto | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dozer-types/protos/telemetry.proto b/dozer-types/protos/telemetry.proto index 0164eddf3a..fc85226282 100644 --- a/dozer-types/protos/telemetry.proto +++ b/dozer-types/protos/telemetry.proto @@ -8,7 +8,11 @@ service TelemetryService { message MetricsRequest { string app_id = 1; - string query = 2; + uint32 query_type = 2; + string query = 3; + uint64 start = 4; + uint64 end = 5; + uint32 step = 6; } message MetricsResponse { string content = 1; } From d1d3b61bca06dc3f0411c5f1e873a6875ebd6f11 Mon Sep 17 00:00:00 2001 From: Dario Pizzamiglio Date: Wed, 13 Sep 2023 22:36:24 +0800 Subject: [PATCH 3/7] add query type --- dozer-types/build.rs | 1 + dozer-types/protos/telemetry.proto | 14 ++++++++++++-- dozer-types/src/grpc_types.rs | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dozer-types/build.rs b/dozer-types/build.rs index e4a3231577..695d15863d 100644 --- a/dozer-types/build.rs +++ b/dozer-types/build.rs @@ -32,6 +32,7 @@ fn main() -> Result<(), Box> { .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"])?; // Sample service generated for tests and development diff --git a/dozer-types/protos/telemetry.proto b/dozer-types/protos/telemetry.proto index fc85226282..ebb8ef06a4 100644 --- a/dozer-types/protos/telemetry.proto +++ b/dozer-types/protos/telemetry.proto @@ -4,11 +4,17 @@ package dozer.telemetry; service TelemetryService { rpc get_metrics(MetricsRequest) returns (MetricsResponse); rpc get_traces(TracesRequest) returns (TracesResponse); + rpc get_trace(TraceRequest) returns (TraceResponse); +} + +enum QueryType { + QUERY = 0; + RANGE = 1; } message MetricsRequest { string app_id = 1; - uint32 query_type = 2; + QueryType query_type = 2; string query = 3; uint64 start = 4; uint64 end = 5; @@ -19,4 +25,8 @@ message MetricsResponse { string content = 1; } message TracesRequest { string app_id = 1; } -message TracesResponse { string content = 1; } \ No newline at end of file +message TracesResponse { string content = 1; } + +message TraceRequest { string trace_id = 1; } + +message TraceResponse { string content = 1; } \ No newline at end of file diff --git a/dozer-types/src/grpc_types.rs b/dozer-types/src/grpc_types.rs index ebd9cb7d40..9e57a0a3ec 100644 --- a/dozer-types/src/grpc_types.rs +++ b/dozer-types/src/grpc_types.rs @@ -58,6 +58,7 @@ pub mod 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"); } // To be used in tests From 35eb6ccb94414bebd0641f6988df3f1baa2dcfbf Mon Sep 17 00:00:00 2001 From: Dario Pizzamiglio Date: Thu, 14 Sep 2023 12:48:52 +0800 Subject: [PATCH 4/7] get full traces method --- dozer-types/protos/telemetry.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dozer-types/protos/telemetry.proto b/dozer-types/protos/telemetry.proto index ebb8ef06a4..346f5c8c9d 100644 --- a/dozer-types/protos/telemetry.proto +++ b/dozer-types/protos/telemetry.proto @@ -4,7 +4,7 @@ package dozer.telemetry; service TelemetryService { rpc get_metrics(MetricsRequest) returns (MetricsResponse); rpc get_traces(TracesRequest) returns (TracesResponse); - rpc get_trace(TraceRequest) returns (TraceResponse); + rpc get_full_traces(FullTracesRequest) returns (FullTracesResponse); } enum QueryType { @@ -27,6 +27,6 @@ message TracesRequest { string app_id = 1; } message TracesResponse { string content = 1; } -message TraceRequest { string trace_id = 1; } +message FullTracesRequest { repeated string trace_ids = 1; } -message TraceResponse { string content = 1; } \ No newline at end of file +message FullTracesResponse { string content = 1; } \ No newline at end of file From 67b60e98b7418083559554f6d8b1902f309e9530 Mon Sep 17 00:00:00 2001 From: Dario Pizzamiglio Date: Thu, 14 Sep 2023 17:33:29 +0800 Subject: [PATCH 5/7] Add start and end to traces --- dozer-types/protos/telemetry.proto | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dozer-types/protos/telemetry.proto b/dozer-types/protos/telemetry.proto index 346f5c8c9d..c8ca3419d4 100644 --- a/dozer-types/protos/telemetry.proto +++ b/dozer-types/protos/telemetry.proto @@ -23,7 +23,11 @@ message MetricsRequest { message MetricsResponse { string content = 1; } -message TracesRequest { string app_id = 1; } +message TracesRequest { + string app_id = 1; + uint64 start = 4; + uint64 end = 5; +} message TracesResponse { string content = 1; } From df72f31ca6874e481383bde3ee2fd5720ecbbaed Mon Sep 17 00:00:00 2001 From: Dario Pizzamiglio Date: Thu, 14 Sep 2023 18:18:39 +0800 Subject: [PATCH 6/7] make range optional --- dozer-types/protos/telemetry.proto | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dozer-types/protos/telemetry.proto b/dozer-types/protos/telemetry.proto index c8ca3419d4..e325628846 100644 --- a/dozer-types/protos/telemetry.proto +++ b/dozer-types/protos/telemetry.proto @@ -16,17 +16,17 @@ message MetricsRequest { string app_id = 1; QueryType query_type = 2; string query = 3; - uint64 start = 4; - uint64 end = 5; - uint32 step = 6; + optional uint64 start = 4; + optional uint64 end = 5; + optional uint32 step = 6; } message MetricsResponse { string content = 1; } message TracesRequest { string app_id = 1; - uint64 start = 4; - uint64 end = 5; + optional uint64 start = 4; + optional uint64 end = 5; } message TracesResponse { string content = 1; } From 270c697b509bac30208cd2d9e3db073e0ee78fc2 Mon Sep 17 00:00:00 2001 From: Dario Pizzamiglio Date: Tue, 19 Sep 2023 10:08:02 +0800 Subject: [PATCH 7/7] Remove traces --- dozer-types/protos/telemetry.proto | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/dozer-types/protos/telemetry.proto b/dozer-types/protos/telemetry.proto index e325628846..ce8291d5c3 100644 --- a/dozer-types/protos/telemetry.proto +++ b/dozer-types/protos/telemetry.proto @@ -3,8 +3,6 @@ package dozer.telemetry; service TelemetryService { rpc get_metrics(MetricsRequest) returns (MetricsResponse); - rpc get_traces(TracesRequest) returns (TracesResponse); - rpc get_full_traces(FullTracesRequest) returns (FullTracesResponse); } enum QueryType { @@ -22,15 +20,3 @@ message MetricsRequest { } message MetricsResponse { string content = 1; } - -message TracesRequest { - string app_id = 1; - optional uint64 start = 4; - optional uint64 end = 5; -} - -message TracesResponse { string content = 1; } - -message FullTracesRequest { repeated string trace_ids = 1; } - -message FullTracesResponse { string content = 1; } \ No newline at end of file