From 212e423bc1fcd7f5531bb1c9a51910beadd5421f Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Wed, 20 Nov 2024 19:44:56 -0500 Subject: [PATCH 1/3] Add missing gogo annotations Signed-off-by: Yuri Shkuro --- proto/api_v3/query_service.proto | 40 +++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/proto/api_v3/query_service.proto b/proto/api_v3/query_service.proto index ebf125e..8be9835 100644 --- a/proto/api_v3/query_service.proto +++ b/proto/api_v3/query_service.proto @@ -24,6 +24,14 @@ import "google/protobuf/duration.proto"; option go_package = "api_v3"; option java_package = "io.jaegertracing.api_v3"; +// Enable gogoprotobuf extensions (https://github.com/gogo/protobuf/blob/master/extensions.md). +// Enable custom Marshal method. +option (gogoproto.marshaler_all) = true; +// Enable custom Unmarshal method. +option (gogoproto.unmarshaler_all) = true; +// Enable custom Size method (Required by Marshal and Unmarshal). +option (gogoproto.sizer_all) = true; + // Request object to get a trace. message GetTraceRequest { // Hex encoded 64 or 128 bit trace ID. @@ -55,20 +63,40 @@ message GetTraceRequest { message TraceQueryParameters { string service_name = 1; string operation_name = 2; + // Attributes are matched against Span and Resource attributes. // At least one span in a trace must match all specified attributes. map attributes = 3; + // Span min start time in. REST API uses RFC-3339ns format. Required. - google.protobuf.Timestamp start_time_min = 4; + google.protobuf.Timestamp start_time_min = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + // Span max start time. REST API uses RFC-3339ns format. Required. - google.protobuf.Timestamp start_time_max = 5; + google.protobuf.Timestamp start_time_max = 5 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + // Span min duration. REST API uses Golang's time format e.g. 10s. - google.protobuf.Duration duration_min = 6; + google.protobuf.Duration duration_min = 6 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false + ]; + // Span max duration. REST API uses Golang's time format e.g. 10s. - google.protobuf.Duration duration_max = 7; + google.protobuf.Duration duration_max = 7 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false + ]; - // Maximum number of traces in the response. - int32 num_traces = 8; + // Maximum depth of search. Depending on the backend storage + // implementtaion this could be like a regular LIMIT clause in SQL, + // but not all implementations support such accuracy and for those + // the larger depth value simply means more traces returned. + int32 search_depth = 8; } // Request object to search traces. From c36a1cb5804ffb1872e33d22a7b03e089717a805 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Wed, 20 Nov 2024 19:47:34 -0500 Subject: [PATCH 2/3] Remove gogo annotations Signed-off-by: Yuri Shkuro --- proto/api_v3/query_service.proto | 41 +++++++------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/proto/api_v3/query_service.proto b/proto/api_v3/query_service.proto index 8be9835..d4b1bb8 100644 --- a/proto/api_v3/query_service.proto +++ b/proto/api_v3/query_service.proto @@ -17,35 +17,22 @@ syntax="proto3"; package jaeger.api_v3; import "opentelemetry/proto/trace/v1/trace.proto"; -import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; option go_package = "api_v3"; option java_package = "io.jaegertracing.api_v3"; -// Enable gogoprotobuf extensions (https://github.com/gogo/protobuf/blob/master/extensions.md). -// Enable custom Marshal method. -option (gogoproto.marshaler_all) = true; -// Enable custom Unmarshal method. -option (gogoproto.unmarshaler_all) = true; -// Enable custom Size method (Required by Marshal and Unmarshal). -option (gogoproto.sizer_all) = true; - // Request object to get a trace. message GetTraceRequest { // Hex encoded 64 or 128 bit trace ID. string trace_id = 1; + // Optional. The start time to search trace ID. - google.protobuf.Timestamp start_time = 2 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; + google.protobuf.Timestamp start_time = 2; + // Optional. The end time to search trace ID. - google.protobuf.Timestamp end_time = 3 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; + google.protobuf.Timestamp end_time = 3; } // Query parameters to find traces. Except for num_traces, all fields should be treated @@ -69,28 +56,16 @@ message TraceQueryParameters { map attributes = 3; // Span min start time in. REST API uses RFC-3339ns format. Required. - google.protobuf.Timestamp start_time_min = 4 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; + google.protobuf.Timestamp start_time_min = 4; // Span max start time. REST API uses RFC-3339ns format. Required. - google.protobuf.Timestamp start_time_max = 5 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; + google.protobuf.Timestamp start_time_max = 5; // Span min duration. REST API uses Golang's time format e.g. 10s. - google.protobuf.Duration duration_min = 6 [ - (gogoproto.stdduration) = true, - (gogoproto.nullable) = false - ]; + google.protobuf.Duration duration_min = 6; // Span max duration. REST API uses Golang's time format e.g. 10s. - google.protobuf.Duration duration_max = 7 [ - (gogoproto.stdduration) = true, - (gogoproto.nullable) = false - ]; + google.protobuf.Duration duration_max = 7; // Maximum depth of search. Depending on the backend storage // implementtaion this could be like a regular LIMIT clause in SQL, From ff64708acc6a255d025c426a2e7247123e2a630b Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Wed, 20 Nov 2024 21:14:48 -0500 Subject: [PATCH 3/3] fix Signed-off-by: Yuri Shkuro --- swagger/api_v3/query_service.swagger.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swagger/api_v3/query_service.swagger.json b/swagger/api_v3/query_service.swagger.json index 45a9c95..b7829cd 100644 --- a/swagger/api_v3/query_service.swagger.json +++ b/swagger/api_v3/query_service.swagger.json @@ -126,8 +126,8 @@ "type": "string" }, { - "name": "query.num_traces", - "description": "Maximum number of traces in the response.", + "name": "query.search_depth", + "description": "Maximum depth of search. Depending on the backend storage\nimplementtaion this could be like a regular LIMIT clause in SQL,\nbut not all implementations support such accuracy and for those\nthe larger depth value simply means more traces returned.", "in": "query", "required": false, "type": "integer", @@ -350,10 +350,10 @@ "type": "string", "description": "Span max duration. REST API uses Golang's time format e.g. 10s." }, - "num_traces": { + "search_depth": { "type": "integer", "format": "int32", - "description": "Maximum number of traces in the response." + "description": "Maximum depth of search. Depending on the backend storage\nimplementtaion this could be like a regular LIMIT clause in SQL,\nbut not all implementations support such accuracy and for those\nthe larger depth value simply means more traces returned." } }, "description": "Query parameters to find traces. Except for num_traces, all fields should be treated\nas forming a conjunction, e.g., \"service_name='X' AND operation_name='Y' AND ...\".\nAll fields are matched against individual spans, not at the trace level.\nThe returned results contain traces where at least one span matches the conditions.\nWhen num_traces results in fewer traces returned, there is no required ordering.\n\nNote: num_traces should restrict the number of traces returned, but not all backends\ninterpret it this way. For instance, in Cassandra this limits the number of _spans_\nthat match the conditions, and the resulting number of traces can be less.\n\nNote: some storage implementations do not guarantee the correct implementation of all parameters."