Skip to content

Commit ae7689a

Browse files
authored
[chore] Update documentation in query_service.proto (#149)
## Which problem is this PR solving? - Towards jaegertracing/jaeger#6629 ## Description of the changes - Cleans up `query_service.proto` to improve the documentation so that it can be re-used for the remote storage API v2 ## How was this change tested? - CI ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Mahad Zaryab <[email protected]>
1 parent 4170920 commit ae7689a

File tree

2 files changed

+62
-41
lines changed

2 files changed

+62
-41
lines changed

proto/api_v3/query_service.proto

+42-25
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
syntax="proto3";
15+
syntax = "proto3";
1616

1717
package jaeger.api_v3;
1818

19-
import "opentelemetry/proto/trace/v1/trace.proto";
20-
import "google/protobuf/timestamp.proto";
2119
import "google/protobuf/duration.proto";
20+
import "google/protobuf/timestamp.proto";
21+
import "opentelemetry/proto/trace/v1/trace.proto";
2222

2323
option go_package = "api_v3";
2424
option java_package = "io.jaegertracing.api_v3";
@@ -40,47 +40,64 @@ message GetTraceRequest {
4040
bool raw_traces = 4;
4141
}
4242

43-
// Query parameters to find traces. Except for num_traces, all fields should be treated
44-
// as forming a conjunction, e.g., "service_name='X' AND operation_name='Y' AND ...".
45-
// All fields are matched against individual spans, not at the trace level.
46-
// The returned results contain traces where at least one span matches the conditions.
47-
// When num_traces results in fewer traces returned, there is no required ordering.
43+
// Query parameters to find traces.
4844
//
49-
// Note: num_traces should restrict the number of traces returned, but not all backends
50-
// interpret it this way. For instance, in Cassandra this limits the number of _spans_
51-
// that match the conditions, and the resulting number of traces can be less.
45+
// All fields form a conjunction (e.g., "service_name='X' AND operation_name='Y' AND ..."),
46+
// except for `search_depth` and `raw_traces`.
5247
//
53-
// Note: some storage implementations do not guarantee the correct implementation of all parameters.
48+
// Fields are matched against individual spans, not the trace level. The results include
49+
// traces with at least one matching span.
5450
//
51+
// The results have no guaranteed ordering.
5552
message TraceQueryParameters {
53+
// service_name filters spans generated by a specific service.
5654
string service_name = 1;
55+
56+
// operation_name filters spans by a specific operation / span name.
5757
string operation_name = 2;
5858

59-
// Attributes are matched against Span and Resource attributes.
60-
// At least one span in a trace must match all specified attributes.
59+
// attributes contains key-value pairs where the key is the attribute name
60+
// and the value is its string representation. Attributes are matched against
61+
// span and resource attributes. At least one span must match all specified attributes.
6162
map<string, string> attributes = 3;
6263

63-
// Span min start time in. REST API uses RFC-3339ns format. Required.
64+
// start_time_min is the start of the time interval (inclusive) for the query.
65+
// Only traces with spans that started on or after this time will be returned.
66+
//
67+
// The HTTP API uses RFC-3339ns format.
68+
//
69+
// This field is required.
6470
google.protobuf.Timestamp start_time_min = 4;
6571

66-
// Span max start time. REST API uses RFC-3339ns format. Required.
72+
// start_time_max is the end of the time interval (exclusive) for the query.
73+
// Only traces with spans that started before this time will be returned.
74+
//
75+
// The HTTP API uses RFC-3339ns format.
76+
//
77+
// This field is required.
6778
google.protobuf.Timestamp start_time_max = 5;
6879

69-
// Span min duration. REST API uses Golang's time format e.g. 10s.
80+
// duration_min is the minimum duration of a span in the trace.
81+
// Only traces with spans that lasted at least this long will be returned.
82+
//
83+
// The HTTP API uses Golang's time format (e.g., "10s").
7084
google.protobuf.Duration duration_min = 6;
7185

72-
// Span max duration. REST API uses Golang's time format e.g. 10s.
86+
// duration_max is the maximum duration of a span in the trace.
87+
// Only traces with spans that lasted at most this long will be returned.
88+
//
89+
// The HTTP API uses Golang's time format (e.g., "10s").
7390
google.protobuf.Duration duration_max = 7;
7491

75-
// Maximum depth of search. Depending on the backend storage
76-
// implementtaion this could be like a regular LIMIT clause in SQL,
77-
// but not all implementations support such accuracy and for those
78-
// the larger depth value simply means more traces returned.
92+
// search_depth defines the maximum search depth. Depending on the backend storage implementation,
93+
// this may behave like an SQL `LIMIT` clause. However, some implementations might not support
94+
// precise limits, and a larger value generally results in more traces being returned.
7995
int32 search_depth = 8;
8096

81-
// Optional. If set to true, the response will not include any
82-
// enrichments to the trace, such as clock skew adjustment.
83-
// Instead, the trace will be returned exactly as stored.
97+
// If set to true, the response will exclude any enrichments to the trace, such as clock skew adjustments.
98+
// The trace will be returned exactly as stored.
99+
//
100+
// This field is optional.
84101
bool raw_traces = 9;
85102
}
86103

swagger/api_v3/query_service.swagger.json

+20-16
Original file line numberDiff line numberDiff line change
@@ -85,57 +85,59 @@
8585
"parameters": [
8686
{
8787
"name": "query.service_name",
88+
"description": "service_name filters spans generated by a specific service.",
8889
"in": "query",
8990
"required": false,
9091
"type": "string"
9192
},
9293
{
9394
"name": "query.operation_name",
95+
"description": "operation_name filters spans by a specific operation / span name.",
9496
"in": "query",
9597
"required": false,
9698
"type": "string"
9799
},
98100
{
99101
"name": "query.start_time_min",
100-
"description": "Span min start time in. REST API uses RFC-3339ns format. Required.",
102+
"description": "start_time_min is the start of the time interval (inclusive) for the query.\nOnly traces with spans that started on or after this time will be returned.\n\nThe HTTP API uses RFC-3339ns format.\n\nThis field is required.",
101103
"in": "query",
102104
"required": false,
103105
"type": "string",
104106
"format": "date-time"
105107
},
106108
{
107109
"name": "query.start_time_max",
108-
"description": "Span max start time. REST API uses RFC-3339ns format. Required.",
110+
"description": "start_time_max is the end of the time interval (exclusive) for the query.\nOnly traces with spans that started before this time will be returned.\n\nThe HTTP API uses RFC-3339ns format.\n\nThis field is required.",
109111
"in": "query",
110112
"required": false,
111113
"type": "string",
112114
"format": "date-time"
113115
},
114116
{
115117
"name": "query.duration_min",
116-
"description": "Span min duration. REST API uses Golang's time format e.g. 10s.",
118+
"description": "duration_min is the minimum duration of a span in the trace.\nOnly traces with spans that lasted at least this long will be returned.\n\nThe HTTP API uses Golang's time format (e.g., \"10s\").",
117119
"in": "query",
118120
"required": false,
119121
"type": "string"
120122
},
121123
{
122124
"name": "query.duration_max",
123-
"description": "Span max duration. REST API uses Golang's time format e.g. 10s.",
125+
"description": "duration_max is the maximum duration of a span in the trace.\nOnly traces with spans that lasted at most this long will be returned.\n\nThe HTTP API uses Golang's time format (e.g., \"10s\").",
124126
"in": "query",
125127
"required": false,
126128
"type": "string"
127129
},
128130
{
129131
"name": "query.search_depth",
130-
"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.",
132+
"description": "search_depth defines the maximum search depth. Depending on the backend storage implementation,\nthis may behave like an SQL `LIMIT` clause. However, some implementations might not support\nprecise limits, and a larger value generally results in more traces being returned.",
131133
"in": "query",
132134
"required": false,
133135
"type": "integer",
134136
"format": "int32"
135137
},
136138
{
137139
"name": "query.raw_traces",
138-
"description": "Optional. If set to true, the response will not include any\nenrichments to the trace, such as clock skew adjustment.\nInstead, the trace will be returned exactly as stored.",
140+
"description": "If set to true, the response will exclude any enrichments to the trace, such as clock skew adjustments.\nThe trace will be returned exactly as stored.\n\nThis field is optional.",
139141
"in": "query",
140142
"required": false,
141143
"type": "boolean"
@@ -334,47 +336,49 @@
334336
"type": "object",
335337
"properties": {
336338
"service_name": {
337-
"type": "string"
339+
"type": "string",
340+
"description": "service_name filters spans generated by a specific service."
338341
},
339342
"operation_name": {
340-
"type": "string"
343+
"type": "string",
344+
"description": "operation_name filters spans by a specific operation / span name."
341345
},
342346
"attributes": {
343347
"type": "object",
344348
"additionalProperties": {
345349
"type": "string"
346350
},
347-
"description": "Attributes are matched against Span and Resource attributes.\nAt least one span in a trace must match all specified attributes."
351+
"description": "attributes contains key-value pairs where the key is the attribute name\nand the value is its string representation. Attributes are matched against\nspan and resource attributes. At least one span must match all specified attributes."
348352
},
349353
"start_time_min": {
350354
"type": "string",
351355
"format": "date-time",
352-
"description": "Span min start time in. REST API uses RFC-3339ns format. Required."
356+
"description": "start_time_min is the start of the time interval (inclusive) for the query.\nOnly traces with spans that started on or after this time will be returned.\n\nThe HTTP API uses RFC-3339ns format.\n\nThis field is required."
353357
},
354358
"start_time_max": {
355359
"type": "string",
356360
"format": "date-time",
357-
"description": "Span max start time. REST API uses RFC-3339ns format. Required."
361+
"description": "start_time_max is the end of the time interval (exclusive) for the query.\nOnly traces with spans that started before this time will be returned.\n\nThe HTTP API uses RFC-3339ns format.\n\nThis field is required."
358362
},
359363
"duration_min": {
360364
"type": "string",
361-
"description": "Span min duration. REST API uses Golang's time format e.g. 10s."
365+
"description": "duration_min is the minimum duration of a span in the trace.\nOnly traces with spans that lasted at least this long will be returned.\n\nThe HTTP API uses Golang's time format (e.g., \"10s\")."
362366
},
363367
"duration_max": {
364368
"type": "string",
365-
"description": "Span max duration. REST API uses Golang's time format e.g. 10s."
369+
"description": "duration_max is the maximum duration of a span in the trace.\nOnly traces with spans that lasted at most this long will be returned.\n\nThe HTTP API uses Golang's time format (e.g., \"10s\")."
366370
},
367371
"search_depth": {
368372
"type": "integer",
369373
"format": "int32",
370-
"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."
374+
"description": "search_depth defines the maximum search depth. Depending on the backend storage implementation,\nthis may behave like an SQL `LIMIT` clause. However, some implementations might not support\nprecise limits, and a larger value generally results in more traces being returned."
371375
},
372376
"raw_traces": {
373377
"type": "boolean",
374-
"description": "Optional. If set to true, the response will not include any\nenrichments to the trace, such as clock skew adjustment.\nInstead, the trace will be returned exactly as stored."
378+
"description": "If set to true, the response will exclude any enrichments to the trace, such as clock skew adjustments.\nThe trace will be returned exactly as stored.\n\nThis field is optional."
375379
}
376380
},
377-
"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."
381+
"description": "Query parameters to find traces.\n\nAll fields form a conjunction (e.g., \"service_name='X' AND operation_name='Y' AND ...\"),\nexcept for `search_depth` and `raw_traces`.\n\nFields are matched against individual spans, not the trace level. The results include\ntraces with at least one matching span.\n\nThe results have no guaranteed ordering."
378382
},
379383
"protobufAny": {
380384
"type": "object",

0 commit comments

Comments
 (0)