1- // Copyright 2017 Google Inc .
1+ // Copyright 2019 Google LLC .
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -17,6 +17,9 @@ syntax = "proto3";
1717package google.devtools.cloudtrace.v1 ;
1818
1919import "google/api/annotations.proto" ;
20+ import "google/api/client.proto" ;
21+ import "google/api/field_behavior.proto" ;
22+ import "google/api/resource.proto" ;
2023import "google/protobuf/empty.proto" ;
2124import "google/protobuf/timestamp.proto" ;
2225
@@ -33,18 +36,26 @@ option php_namespace = "Google\\Cloud\\Trace\\V1";
3336// timed event which forms a node of the trace tree. Spans for a single trace
3437// may span multiple services.
3538service 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+
3645 // Returns of a list of traces that match the specified filter conditions.
3746 rpc ListTraces (ListTracesRequest ) returns (ListTracesResponse ) {
3847 option (google.api.http ) = {
3948 get : "/v1/projects/{project_id}/traces"
4049 };
50+ option (google.api.method_signature ) = "project_id" ;
4151 }
4252
4353 // Gets a single trace by its ID.
4454 rpc GetTrace (GetTraceRequest ) returns (Trace ) {
4555 option (google.api.http ) = {
4656 get : "/v1/projects/{project_id}/traces/{trace_id}"
4757 };
58+ option (google.api.method_signature ) = "project_id,trace_id" ;
4859 }
4960
5061 // Sends new traces to Stackdriver Trace or updates existing traces. If the ID
@@ -57,6 +68,7 @@ service TraceService {
5768 patch : "/v1/projects/{project_id}/traces"
5869 body : "traces"
5970 };
71+ option (google.api.method_signature ) = "project_id,traces" ;
6072 }
6173}
6274
@@ -68,7 +80,8 @@ message Trace {
6880 string project_id = 1 ;
6981
7082 // 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`.
7285 string trace_id = 2 ;
7386
7487 // Collection of spans in the trace.
@@ -103,7 +116,7 @@ message TraceSpan {
103116 }
104117
105118 // 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`.
107120 fixed64 span_id = 1 ;
108121
109122 // Distinguishes between spans generated in a particular context. For example,
@@ -113,7 +126,7 @@ message TraceSpan {
113126
114127 // Name of the span. Must be less than 128 bytes. The span name is sanitized
115128 // and displayed in the Stackdriver Trace tool in the
116- // {% dynamic print site_values.console_name %} .
129+ // Google Cloud Platform Console .
117130 // The name may be a method name or some other per-call site name.
118131 // For the same executable and the same call point, a best practice is
119132 // to use a consistent name, which makes it easier to correlate
@@ -126,8 +139,8 @@ message TraceSpan {
126139 // End time of the span in nanoseconds from the UNIX epoch.
127140 google.protobuf.Timestamp end_time = 5 ;
128141
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 ] ;
131144
132145 // Collection of labels associated with the span. Label keys must be less than
133146 // 128 bytes. Label values must be less than 16 kilobytes (10MB for
@@ -189,20 +202,20 @@ message ListTracesRequest {
189202 COMPLETE = 3 ;
190203 }
191204
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 ] ;
194207
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
196209 // `MINIMAL`.
197- ViewType view = 2 ;
210+ ViewType view = 2 [ (google.api .field_behavior ) = OPTIONAL ] ;
198211
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
200213 // 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 ] ;
203216
204217 // 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.
206219 string page_token = 4 ;
207220
208221 // Start of the time interval (inclusive) during which the trace data was
@@ -213,7 +226,7 @@ message ListTracesRequest {
213226 // collected from the application.
214227 google.protobuf.Timestamp end_time = 6 ;
215228
216- // An optional filter against labels for the request.
229+ // Optional. A filter against labels for the request.
217230 //
218231 // By default, searches use prefix matching. To specify exact match, prepend
219232 // a plus symbol (`+`) to the search term.
@@ -243,9 +256,9 @@ message ListTracesRequest {
243256 // specified.
244257 // * `method:VALUE`: Equivalent to `/http/method:VALUE`.
245258 // * `url:VALUE`: Equivalent to `/http/url:VALUE`.
246- string filter = 7 ;
259+ string filter = 7 [ (google.api .field_behavior ) = OPTIONAL ] ;
247260
248- // Field used to sort the returned traces. Optional .
261+ // Optional. Field used to sort the returned traces.
249262 // Can be one of the following:
250263 //
251264 // * `trace_id`
@@ -258,12 +271,12 @@ message ListTracesRequest {
258271 // (for example, `name desc`).
259272 //
260273 // Only one sort field is permitted.
261- string order_by = 8 ;
274+ string order_by = 8 [ (google.api .field_behavior ) = OPTIONAL ] ;
262275}
263276
264277// The response message for the `ListTraces` method.
265278message ListTracesResponse {
266- // List of trace records returned .
279+ // List of trace records as specified by the view parameter .
267280 repeated Trace traces = 1 ;
268281
269282 // If defined, indicates that there are more traces that match the request
@@ -274,18 +287,18 @@ message ListTracesResponse {
274287
275288// The request message for the `GetTrace` method.
276289message 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 ] ;
279292
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 ] ;
282295}
283296
284297// The request message for the `PatchTraces` method.
285298message 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 ] ;
288301
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 ] ;
291304}
0 commit comments