1
- // Copyright 2017 Google Inc .
1
+ // Copyright 2019 Google LLC .
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -17,6 +17,9 @@ syntax = "proto3";
17
17
package google.devtools.cloudtrace.v1 ;
18
18
19
19
import "google/api/annotations.proto" ;
20
+ import "google/api/client.proto" ;
21
+ import "google/api/field_behavior.proto" ;
22
+ import "google/api/resource.proto" ;
20
23
import "google/protobuf/empty.proto" ;
21
24
import "google/protobuf/timestamp.proto" ;
22
25
@@ -33,18 +36,26 @@ option php_namespace = "Google\\Cloud\\Trace\\V1";
33
36
// timed event which forms a node of the trace tree. Spans for a single trace
34
37
// may span multiple services.
35
38
service TraceService {
39
+ option (google.api.default_host ) = "cloudtrace.googleapis.com" ;
40
+ option (google.api.oauth_scopes ) =
41
+ "https://www.googleapis.com/auth/cloud-platform,"
42
+ "https://www.googleapis.com/auth/trace.append,"
43
+ "https://www.googleapis.com/auth/trace.readonly" ;
44
+
36
45
// Returns of a list of traces that match the specified filter conditions.
37
46
rpc ListTraces (ListTracesRequest ) returns (ListTracesResponse ) {
38
47
option (google.api.http ) = {
39
48
get : "/v1/projects/{project_id}/traces"
40
49
};
50
+ option (google.api.method_signature ) = "project_id" ;
41
51
}
42
52
43
53
// Gets a single trace by its ID.
44
54
rpc GetTrace (GetTraceRequest ) returns (Trace ) {
45
55
option (google.api.http ) = {
46
56
get : "/v1/projects/{project_id}/traces/{trace_id}"
47
57
};
58
+ option (google.api.method_signature ) = "project_id,trace_id" ;
48
59
}
49
60
50
61
// Sends new traces to Stackdriver Trace or updates existing traces. If the ID
@@ -57,6 +68,7 @@ service TraceService {
57
68
patch : "/v1/projects/{project_id}/traces"
58
69
body : "traces"
59
70
};
71
+ option (google.api.method_signature ) = "project_id,traces" ;
60
72
}
61
73
}
62
74
@@ -68,7 +80,8 @@ message Trace {
68
80
string project_id = 1 ;
69
81
70
82
// Globally unique identifier for the trace. This identifier is a 128-bit
71
- // numeric value formatted as a 32-byte hex string.
83
+ // numeric value formatted as a 32-byte hex string. For example,
84
+ // `382d4f4c6b7bb2f4a972559d9085001d`.
72
85
string trace_id = 2 ;
73
86
74
87
// Collection of spans in the trace.
@@ -103,7 +116,7 @@ message TraceSpan {
103
116
}
104
117
105
118
// Identifier for the span. Must be a 64-bit integer other than 0 and
106
- // unique within a trace.
119
+ // unique within a trace. For example, `2205310701640571284`.
107
120
fixed64 span_id = 1 ;
108
121
109
122
// Distinguishes between spans generated in a particular context. For example,
@@ -113,7 +126,7 @@ message TraceSpan {
113
126
114
127
// Name of the span. Must be less than 128 bytes. The span name is sanitized
115
128
// and displayed in the Stackdriver Trace tool in the
116
- // {% dynamic print site_values.console_name %} .
129
+ // Google Cloud Platform Console .
117
130
// The name may be a method name or some other per-call site name.
118
131
// For the same executable and the same call point, a best practice is
119
132
// to use a consistent name, which makes it easier to correlate
@@ -126,8 +139,8 @@ message TraceSpan {
126
139
// End time of the span in nanoseconds from the UNIX epoch.
127
140
google.protobuf.Timestamp end_time = 5 ;
128
141
129
- // ID of the parent span, if any. Optional .
130
- fixed64 parent_span_id = 6 ;
142
+ // Optional. ID of the parent span, if any.
143
+ fixed64 parent_span_id = 6 [ (google.api .field_behavior ) = OPTIONAL ] ;
131
144
132
145
// Collection of labels associated with the span. Label keys must be less than
133
146
// 128 bytes. Label values must be less than 16 kilobytes (10MB for
@@ -189,20 +202,20 @@ message ListTracesRequest {
189
202
COMPLETE = 3 ;
190
203
}
191
204
192
- // ID of the Cloud project where the trace data is stored.
193
- string project_id = 1 ;
205
+ // Required. ID of the Cloud project where the trace data is stored.
206
+ string project_id = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
194
207
195
- // Type of data returned for traces in the list. Optional . Default is
208
+ // Optional. Type of data returned for traces in the list. Default is
196
209
// `MINIMAL`.
197
- ViewType view = 2 ;
210
+ ViewType view = 2 [ (google.api .field_behavior ) = OPTIONAL ] ;
198
211
199
- // Maximum number of traces to return. If not specified or <= 0, the
212
+ // Optional. Maximum number of traces to return. If not specified or <= 0, the
200
213
// implementation selects a reasonable value. The implementation may
201
- // return fewer traces than the requested page size. Optional.
202
- int32 page_size = 3 ;
214
+ // return fewer traces than the requested page size.
215
+ int32 page_size = 3 [ (google.api .field_behavior ) = OPTIONAL ] ;
203
216
204
217
// Token identifying the page of results to return. If provided, use the
205
- // value of the `next_page_token` field from a previous request. Optional.
218
+ // value of the `next_page_token` field from a previous request.
206
219
string page_token = 4 ;
207
220
208
221
// Start of the time interval (inclusive) during which the trace data was
@@ -213,7 +226,7 @@ message ListTracesRequest {
213
226
// collected from the application.
214
227
google.protobuf.Timestamp end_time = 6 ;
215
228
216
- // An optional filter against labels for the request.
229
+ // Optional. A filter against labels for the request.
217
230
//
218
231
// By default, searches use prefix matching. To specify exact match, prepend
219
232
// a plus symbol (`+`) to the search term.
@@ -243,9 +256,9 @@ message ListTracesRequest {
243
256
// specified.
244
257
// * `method:VALUE`: Equivalent to `/http/method:VALUE`.
245
258
// * `url:VALUE`: Equivalent to `/http/url:VALUE`.
246
- string filter = 7 ;
259
+ string filter = 7 [ (google.api .field_behavior ) = OPTIONAL ] ;
247
260
248
- // Field used to sort the returned traces. Optional .
261
+ // Optional. Field used to sort the returned traces.
249
262
// Can be one of the following:
250
263
//
251
264
// * `trace_id`
@@ -258,12 +271,12 @@ message ListTracesRequest {
258
271
// (for example, `name desc`).
259
272
//
260
273
// Only one sort field is permitted.
261
- string order_by = 8 ;
274
+ string order_by = 8 [ (google.api .field_behavior ) = OPTIONAL ] ;
262
275
}
263
276
264
277
// The response message for the `ListTraces` method.
265
278
message ListTracesResponse {
266
- // List of trace records returned .
279
+ // List of trace records as specified by the view parameter .
267
280
repeated Trace traces = 1 ;
268
281
269
282
// If defined, indicates that there are more traces that match the request
@@ -274,18 +287,18 @@ message ListTracesResponse {
274
287
275
288
// The request message for the `GetTrace` method.
276
289
message GetTraceRequest {
277
- // ID of the Cloud project where the trace data is stored.
278
- string project_id = 1 ;
290
+ // Required. ID of the Cloud project where the trace data is stored.
291
+ string project_id = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
279
292
280
- // ID of the trace to return.
281
- string trace_id = 2 ;
293
+ // Required. ID of the trace to return.
294
+ string trace_id = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
282
295
}
283
296
284
297
// The request message for the `PatchTraces` method.
285
298
message PatchTracesRequest {
286
- // ID of the Cloud project where the trace data is stored.
287
- string project_id = 1 ;
299
+ // Required. ID of the Cloud project where the trace data is stored.
300
+ string project_id = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
288
301
289
- // The body of the message.
290
- Traces traces = 2 ;
302
+ // Required. The body of the message.
303
+ Traces traces = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
291
304
}
0 commit comments