OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.tracing.v1; | 3 library googleapis.tracing.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 uploadMedia: _uploadMedia, | 98 uploadMedia: _uploadMedia, |
99 downloadOptions: _downloadOptions); | 99 downloadOptions: _downloadOptions); |
100 return _response.then((data) => new Empty.fromJson(data)); | 100 return _response.then((data) => new Empty.fromJson(data)); |
101 } | 101 } |
102 | 102 |
103 /** | 103 /** |
104 * Returns a specific trace. | 104 * Returns a specific trace. |
105 * | 105 * |
106 * Request parameters: | 106 * Request parameters: |
107 * | 107 * |
108 * [name] - ID of the trace which is | 108 * [name] - ID of the trace. Format is `projects/PROJECT_ID/traces/TRACE_ID`. |
109 * "projects/<project_id>/traces/<trace_id>". | |
110 * Value must have pattern "^projects/[^/]+/traces/[^/]+$". | 109 * Value must have pattern "^projects/[^/]+/traces/[^/]+$". |
111 * | 110 * |
112 * Completes with a [Trace]. | 111 * Completes with a [Trace]. |
113 * | 112 * |
114 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 113 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
115 * error. | 114 * error. |
116 * | 115 * |
117 * If the used [http.Client] completes with an error when making a REST call, | 116 * If the used [http.Client] completes with an error when making a REST call, |
118 * this method will complete with the same error. | 117 * this method will complete with the same error. |
119 */ | 118 */ |
(...skipping 22 matching lines...) Expand all Loading... |
142 } | 141 } |
143 | 142 |
144 /** | 143 /** |
145 * Returns of a list of traces that match the specified filter conditions. | 144 * Returns of a list of traces that match the specified filter conditions. |
146 * | 145 * |
147 * Request parameters: | 146 * Request parameters: |
148 * | 147 * |
149 * [parent] - ID of the Cloud project where the trace data is stored. | 148 * [parent] - ID of the Cloud project where the trace data is stored. |
150 * Value must have pattern "^projects/[^/]+$". | 149 * Value must have pattern "^projects/[^/]+$". |
151 * | 150 * |
| 151 * [filter] - An optional filter for the request. |
| 152 * Example: |
| 153 * `version_label_key:a some_label:some_label_key` |
| 154 * returns traces from version `a` and has `some_label` with `some_label_key`. |
| 155 * |
| 156 * [endTime] - End of the time interval (inclusive) during which the trace |
| 157 * data was |
| 158 * collected from the application. |
| 159 * |
| 160 * [startTime] - Start of the time interval (inclusive) during which the trace |
| 161 * data was |
| 162 * collected from the application. |
| 163 * |
| 164 * [pageToken] - Token identifying the page of results to return. If provided, |
| 165 * use the |
| 166 * value of the `next_page_token` field from a previous request. Optional. |
| 167 * |
152 * [pageSize] - Maximum number of traces to return. If not specified or <= 0, | 168 * [pageSize] - Maximum number of traces to return. If not specified or <= 0, |
153 * the | 169 * the |
154 * implementation selects a reasonable value. The implementation may | 170 * implementation selects a reasonable value. The implementation may |
155 * return fewer traces than the requested page size. Optional. | 171 * return fewer traces than the requested page size. Optional. |
156 * | 172 * |
157 * [orderBy] - Field used to sort the returned traces. Optional. | 173 * [orderBy] - Field used to sort the returned traces. Optional. |
158 * Can be one of the following: | 174 * Can be one of the following: |
159 * | 175 * |
160 * * `trace_id` | 176 * * `trace_id` |
161 * * `name` (`name` field of root span in the trace) | 177 * * `name` (`name` field of root span in the trace) |
162 * * `duration` (difference between `end_time` and `start_time` fields of | 178 * * `duration` (difference between `end_time` and `start_time` fields of |
163 * the root span) | 179 * the root span) |
164 * * `start` (`start_time` field of the root span) | 180 * * `start` (`start_time` field of the root span) |
165 * | 181 * |
166 * Descending order can be specified by appending `desc` to the sort field | 182 * Descending order can be specified by appending `desc` to the sort field |
167 * (for example, `name desc`). | 183 * (for example, `name desc`). |
168 * | 184 * |
169 * Only one sort field is permitted. | 185 * Only one sort field is permitted. |
170 * | 186 * |
171 * [filter] - An optional filter for the request. | |
172 * Example: | |
173 * "version_label_key:a some_label:some_label_key" | |
174 * returns traces from version a and has some_label with some_label_key. | |
175 * | |
176 * [endTime] - End of the time interval (inclusive) during which the trace | |
177 * data was | |
178 * collected from the application. | |
179 * | |
180 * [pageToken] - Token identifying the page of results to return. If provided, | |
181 * use the | |
182 * value of the `next_page_token` field from a previous request. Optional. | |
183 * | |
184 * [startTime] - Start of the time interval (inclusive) during which the trace | |
185 * data was | |
186 * collected from the application. | |
187 * | |
188 * Completes with a [ListTracesResponse]. | 187 * Completes with a [ListTracesResponse]. |
189 * | 188 * |
190 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 189 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
191 * error. | 190 * error. |
192 * | 191 * |
193 * If the used [http.Client] completes with an error when making a REST call, | 192 * If the used [http.Client] completes with an error when making a REST call, |
194 * this method will complete with the same error. | 193 * this method will complete with the same error. |
195 */ | 194 */ |
196 async.Future<ListTracesResponse> list(core.String parent, {core.int pageSize,
core.String orderBy, core.String filter, core.String endTime, core.String pageTo
ken, core.String startTime}) { | 195 async.Future<ListTracesResponse> list(core.String parent, {core.String filter,
core.String endTime, core.String startTime, core.String pageToken, core.int pag
eSize, core.String orderBy}) { |
197 var _url = null; | 196 var _url = null; |
198 var _queryParams = new core.Map(); | 197 var _queryParams = new core.Map(); |
199 var _uploadMedia = null; | 198 var _uploadMedia = null; |
200 var _uploadOptions = null; | 199 var _uploadOptions = null; |
201 var _downloadOptions = commons.DownloadOptions.Metadata; | 200 var _downloadOptions = commons.DownloadOptions.Metadata; |
202 var _body = null; | 201 var _body = null; |
203 | 202 |
204 if (parent == null) { | 203 if (parent == null) { |
205 throw new core.ArgumentError("Parameter parent is required."); | 204 throw new core.ArgumentError("Parameter parent is required."); |
206 } | 205 } |
| 206 if (filter != null) { |
| 207 _queryParams["filter"] = [filter]; |
| 208 } |
| 209 if (endTime != null) { |
| 210 _queryParams["endTime"] = [endTime]; |
| 211 } |
| 212 if (startTime != null) { |
| 213 _queryParams["startTime"] = [startTime]; |
| 214 } |
| 215 if (pageToken != null) { |
| 216 _queryParams["pageToken"] = [pageToken]; |
| 217 } |
207 if (pageSize != null) { | 218 if (pageSize != null) { |
208 _queryParams["pageSize"] = ["${pageSize}"]; | 219 _queryParams["pageSize"] = ["${pageSize}"]; |
209 } | 220 } |
210 if (orderBy != null) { | 221 if (orderBy != null) { |
211 _queryParams["orderBy"] = [orderBy]; | 222 _queryParams["orderBy"] = [orderBy]; |
212 } | 223 } |
213 if (filter != null) { | |
214 _queryParams["filter"] = [filter]; | |
215 } | |
216 if (endTime != null) { | |
217 _queryParams["endTime"] = [endTime]; | |
218 } | |
219 if (pageToken != null) { | |
220 _queryParams["pageToken"] = [pageToken]; | |
221 } | |
222 if (startTime != null) { | |
223 _queryParams["startTime"] = [startTime]; | |
224 } | |
225 | 224 |
226 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/traces'; | 225 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/traces'; |
227 | 226 |
228 var _response = _requester.request(_url, | 227 var _response = _requester.request(_url, |
229 "GET", | 228 "GET", |
230 body: _body, | 229 body: _body, |
231 queryParams: _queryParams, | 230 queryParams: _queryParams, |
232 uploadOptions: _uploadOptions, | 231 uploadOptions: _uploadOptions, |
233 uploadMedia: _uploadMedia, | 232 uploadMedia: _uploadMedia, |
234 downloadOptions: _downloadOptions); | 233 downloadOptions: _downloadOptions); |
235 return _response.then((data) => new ListTracesResponse.fromJson(data)); | 234 return _response.then((data) => new ListTracesResponse.fromJson(data)); |
236 } | 235 } |
237 | 236 |
238 /** | 237 /** |
239 * Returns a list of spans within a trace. | 238 * Returns a list of spans within a trace. |
240 * | 239 * |
241 * Request parameters: | 240 * Request parameters: |
242 * | 241 * |
243 * [name] - ID of the span set where is | 242 * [name] - ID of the trace for which to list child spans. Format is |
244 * "projects/<project_id>/traces/<trace_id>". | 243 * `projects/PROJECT_ID/traces/TRACE_ID`. |
245 * Value must have pattern "^projects/[^/]+/traces/[^/]+$". | 244 * Value must have pattern "^projects/[^/]+/traces/[^/]+$". |
246 * | 245 * |
247 * [pageToken] - Token identifying the page of results to return. If provided, | 246 * [pageToken] - Token identifying the page of results to return. If provided, |
248 * use the | 247 * use the |
249 * value of the `page_token` field from a previous request. Optional. | 248 * value of the `nextPageToken` field from a previous request. Optional. |
250 * | 249 * |
251 * Completes with a [ListSpansResponse]. | 250 * Completes with a [ListSpansResponse]. |
252 * | 251 * |
253 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 252 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
254 * error. | 253 * error. |
255 * | 254 * |
256 * If the used [http.Client] completes with an error when making a REST call, | 255 * If the used [http.Client] completes with an error when making a REST call, |
257 * this method will complete with the same error. | 256 * this method will complete with the same error. |
258 */ | 257 */ |
259 async.Future<ListSpansResponse> listSpans(core.String name, {core.String pageT
oken}) { | 258 async.Future<ListSpansResponse> listSpans(core.String name, {core.String pageT
oken}) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 if (attributes != null) { | 309 if (attributes != null) { |
311 _json["attributes"] = commons.mapMap(attributes, (item) => (item).toJson()
); | 310 _json["attributes"] = commons.mapMap(attributes, (item) => (item).toJson()
); |
312 } | 311 } |
313 if (description != null) { | 312 if (description != null) { |
314 _json["description"] = description; | 313 _json["description"] = description; |
315 } | 314 } |
316 return _json; | 315 return _json; |
317 } | 316 } |
318 } | 317 } |
319 | 318 |
320 /** Allowed attribute values. */ | 319 /** The allowed types for the value side of an attribute key:value pair. */ |
321 class AttributeValue { | 320 class AttributeValue { |
322 /** A boolean value. */ | 321 /** A boolean value. */ |
323 core.bool boolValue; | 322 core.bool boolValue; |
324 /** An integer value. */ | 323 /** An integer value. */ |
325 core.String intValue; | 324 core.String intValue; |
326 /** A string value. */ | 325 /** A string value. */ |
327 core.String stringValue; | 326 core.String stringValue; |
328 | 327 |
329 AttributeValue(); | 328 AttributeValue(); |
330 | 329 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 Empty.fromJson(core.Map _json) { | 394 Empty.fromJson(core.Map _json) { |
396 } | 395 } |
397 | 396 |
398 core.Map toJson() { | 397 core.Map toJson() { |
399 var _json = new core.Map(); | 398 var _json = new core.Map(); |
400 return _json; | 399 return _json; |
401 } | 400 } |
402 } | 401 } |
403 | 402 |
404 /** | 403 /** |
405 * Link one span with another which may be in a different Trace. Used (for | 404 * A pointer from this span to another span in a different `Trace`. Used |
406 * example) in batching operations, where a single batch handler processes | 405 * (for example) in batching operations, where a single batch handler |
407 * multiple requests from different traces. | 406 * processes multiple requests from different traces. |
408 */ | 407 */ |
409 class Link { | 408 class Link { |
410 /** The span identifier of the linked span. */ | 409 /** The `id` of the linked span. */ |
411 core.String spanId; | 410 core.String spanId; |
412 /** The trace identifier of the linked span. */ | 411 /** The ID of the parent trace of the linked span. */ |
413 core.String traceId; | 412 core.String traceId; |
414 /** | 413 /** |
415 * The type of the link. | 414 * The relationship of the current span relative to the linked span. |
416 * Possible string values are: | 415 * Possible string values are: |
417 * - "TYPE_UNSPECIFIED" : The relation of current span and linked span is | 416 * - "TYPE_UNSPECIFIED" : The relationship of the two spans is unknown. |
418 * unknown. | 417 * - "CHILD" : The current span is a child of the linked span. |
419 * - "CHILD" : Current span is child of the linked span. | 418 * - "PARENT" : The current span is the parent of the linked span. |
420 * - "PARENT" : Current span is parent of the linked span. | |
421 */ | 419 */ |
422 core.String type; | 420 core.String type; |
423 | 421 |
424 Link(); | 422 Link(); |
425 | 423 |
426 Link.fromJson(core.Map _json) { | 424 Link.fromJson(core.Map _json) { |
427 if (_json.containsKey("spanId")) { | 425 if (_json.containsKey("spanId")) { |
428 spanId = _json["spanId"]; | 426 spanId = _json["spanId"]; |
429 } | 427 } |
430 if (_json.containsKey("traceId")) { | 428 if (_json.containsKey("traceId")) { |
(...skipping 12 matching lines...) Expand all Loading... |
443 if (traceId != null) { | 441 if (traceId != null) { |
444 _json["traceId"] = traceId; | 442 _json["traceId"] = traceId; |
445 } | 443 } |
446 if (type != null) { | 444 if (type != null) { |
447 _json["type"] = type; | 445 _json["type"] = type; |
448 } | 446 } |
449 return _json; | 447 return _json; |
450 } | 448 } |
451 } | 449 } |
452 | 450 |
453 /** The response message for the 'ListSpans' method. */ | 451 /** The response message for the `ListSpans` method. */ |
454 class ListSpansResponse { | 452 class ListSpansResponse { |
455 /** | 453 /** |
456 * If defined, indicates that there are more spans that match the request | 454 * If defined, indicates that there are more spans that match the request. |
457 * and that this value should be passed to the next request to continue | 455 * Pass this as the value of `pageToken` in a subsequent request to retrieve |
458 * retrieving additional spans. | 456 * additional spans. |
459 */ | 457 */ |
460 core.String nextPageToken; | 458 core.String nextPageToken; |
461 /** The requested spans if they are any in the specified trace. */ | 459 /** The requested spans if there are any in the specified trace. */ |
462 core.List<Span> spans; | 460 core.List<Span> spans; |
463 | 461 |
464 ListSpansResponse(); | 462 ListSpansResponse(); |
465 | 463 |
466 ListSpansResponse.fromJson(core.Map _json) { | 464 ListSpansResponse.fromJson(core.Map _json) { |
467 if (_json.containsKey("nextPageToken")) { | 465 if (_json.containsKey("nextPageToken")) { |
468 nextPageToken = _json["nextPageToken"]; | 466 nextPageToken = _json["nextPageToken"]; |
469 } | 467 } |
470 if (_json.containsKey("spans")) { | 468 if (_json.containsKey("spans")) { |
471 spans = _json["spans"].map((value) => new Span.fromJson(value)).toList(); | 469 spans = _json["spans"].map((value) => new Span.fromJson(value)).toList(); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 _json["module"] = module; | 549 _json["module"] = module; |
552 } | 550 } |
553 return _json; | 551 return _json; |
554 } | 552 } |
555 } | 553 } |
556 | 554 |
557 /** An event describing an RPC message sent/received on the network. */ | 555 /** An event describing an RPC message sent/received on the network. */ |
558 class NetworkEvent { | 556 class NetworkEvent { |
559 /** | 557 /** |
560 * If available, this is the kernel time: | 558 * If available, this is the kernel time: |
561 * For sent messages, this is the time at which the first bit was sent. | 559 * |
562 * For received messages, this is the time at which the last bit was | 560 * * For sent messages, this is the time at which the first bit was sent. |
563 * received. | 561 * * For received messages, this is the time at which the last bit was |
| 562 * received. |
564 */ | 563 */ |
565 core.String kernelTime; | 564 core.String kernelTime; |
566 /** | 565 /** An identifier for the message, which must be unique in this span. */ |
567 * Every message has an identifier, which must be different from all the | |
568 * network messages in this span. | |
569 * This is especially important when the request/response are streamed. | |
570 */ | |
571 core.String messageId; | 566 core.String messageId; |
572 /** Number of bytes send/receive. */ | 567 /** The number of bytes sent or received. */ |
573 core.String messageSize; | 568 core.String messageSize; |
574 /** | 569 /** |
575 * Type of a NetworkEvent. | 570 * Type of NetworkEvent. Indicates whether the RPC message was sent or |
| 571 * received. |
576 * Possible string values are: | 572 * Possible string values are: |
577 * - "TYPE_UNSPECIFIED" : Unknown event. | 573 * - "TYPE_UNSPECIFIED" : Unknown event type. |
578 * - "SENT" : Event type for sending RPC message. | 574 * - "SENT" : Indicates a sent RPC message. |
579 * - "RECV" : Event type for receiving RPC message. | 575 * - "RECV" : Indicates a received RPC message. |
580 */ | 576 */ |
581 core.String type; | 577 core.String type; |
582 | 578 |
583 NetworkEvent(); | 579 NetworkEvent(); |
584 | 580 |
585 NetworkEvent.fromJson(core.Map _json) { | 581 NetworkEvent.fromJson(core.Map _json) { |
586 if (_json.containsKey("kernelTime")) { | 582 if (_json.containsKey("kernelTime")) { |
587 kernelTime = _json["kernelTime"]; | 583 kernelTime = _json["kernelTime"]; |
588 } | 584 } |
589 if (_json.containsKey("messageId")) { | 585 if (_json.containsKey("messageId")) { |
(...skipping 20 matching lines...) Expand all Loading... |
610 } | 606 } |
611 if (type != null) { | 607 if (type != null) { |
612 _json["type"] = type; | 608 _json["type"] = type; |
613 } | 609 } |
614 return _json; | 610 return _json; |
615 } | 611 } |
616 } | 612 } |
617 | 613 |
618 /** | 614 /** |
619 * A span represents a single operation within a trace. Spans can be nested | 615 * A span represents a single operation within a trace. Spans can be nested |
620 * and form a trace tree. Often, a trace contains a root span that describes the | 616 * to form a trace tree. Often, a trace contains a root span that |
621 * end-to-end latency and, optionally, one or more subspans for | 617 * describes the end-to-end latency and, optionally, one or more subspans for |
622 * its sub-operations. Spans do not need to be contiguous. There may be gaps | 618 * its sub-operations. (A trace could alternatively contain multiple root spans, |
623 * between spans in a trace. | 619 * or none at all.) Spans do not need to be contiguous. There may be gaps |
| 620 * and/or overlaps between spans in a trace. |
624 */ | 621 */ |
625 class Span { | 622 class Span { |
626 /** | 623 /** |
627 * Properties of a span. Attributes at the span level. | 624 * Properties of a span in key:value format. The maximum length for the |
628 * E.g. | 625 * key is 128 characters. The value can be a string (up to 2000 characters), |
629 * "/instance_id": "my-instance" | 626 * int, or boolean. |
630 * "/zone": "us-central1-a" | |
631 * "/grpc/peer_address": "ip:port" (dns, etc.) | |
632 * "/grpc/deadline": "Duration" | |
633 * "/http/user_agent" | |
634 * "/http/request_bytes": 300 | |
635 * "/http/response_bytes": 1200 | |
636 * "/http/url": google.com/apis | |
637 * "/pid" | |
638 * "abc.com/myattribute": "my attribute value" | |
639 * | 627 * |
640 * Maximum length for attribute key is 128 characters, for string attribute | 628 * Some common pair examples: |
641 * value is 2K characters. | 629 * |
| 630 * "/instance_id": "my-instance" |
| 631 * "/zone": "us-central1-a" |
| 632 * "/grpc/peer_address": "ip:port" (dns, etc.) |
| 633 * "/grpc/deadline": "Duration" |
| 634 * "/http/user_agent" |
| 635 * "/http/request_bytes": 300 |
| 636 * "/http/response_bytes": 1200 |
| 637 * "/http/url": google.com/apis |
| 638 * "abc.com/myattribute": true |
642 */ | 639 */ |
643 core.Map<core.String, AttributeValue> attributes; | 640 core.Map<core.String, AttributeValue> attributes; |
644 /** True if this Span has a remote parent (is an RPC server Span). */ | 641 /** True if this span has a remote parent (is an RPC server span). */ |
645 core.bool hasRemoteParent; | 642 core.bool hasRemoteParent; |
646 /** | 643 /** |
647 * Identifier for the span. Must be a 64-bit integer other than 0 and | 644 * Identifier for the span. Must be a 64-bit integer other than 0 and |
648 * unique within a trace. | 645 * unique within a trace. |
649 */ | 646 */ |
650 core.String id; | 647 core.String id; |
651 /** A collection of links. */ | 648 /** |
| 649 * A collection of links, which are references from this span to another span |
| 650 * in a different trace. |
| 651 */ |
652 core.List<Link> links; | 652 core.List<Link> links; |
653 /** | 653 /** |
654 * Local machine clock time from the UNIX epoch, | 654 * End time of the span. |
655 * at which span execution ended. | 655 * On the client side, this is the local machine clock time at which the span |
656 * On the server side these are the times when the server application | 656 * execution was ended; on the server |
657 * handler finishes running. | 657 * side, this is the time at which the server application handler stopped |
| 658 * running. |
658 */ | 659 */ |
659 core.String localEndTime; | 660 core.String localEndTime; |
660 /** | 661 /** |
661 * Local machine clock time from the UNIX epoch, | 662 * Start time of the span. |
662 * at which span execution started. | 663 * On the client side, this is the local machine clock time at which the span |
663 * On the server side these are the times when the server application | 664 * execution was started; on the server |
664 * handler starts running. | 665 * side, this is the time at which the server application handler started |
| 666 * running. |
665 */ | 667 */ |
666 core.String localStartTime; | 668 core.String localStartTime; |
667 /** | 669 /** |
668 * Name of the span. The span name is sanitized and displayed in the | 670 * Name of the span. The span name is sanitized and displayed in the |
669 * Stackdriver Trace tool in the {% dynamic print site_values.console_name %}. | 671 * Stackdriver Trace tool in the {% dynamic print site_values.console_name %}. |
670 * The name may be a method name or some other per-call site name. | 672 * The name may be a method name or some other per-call site name. |
671 * For the same executable and the same call point, a best practice is | 673 * For the same executable and the same call point, a best practice is |
672 * to use a consistent name, which makes it easier to correlate | 674 * to use a consistent name, which makes it easier to correlate |
673 * cross-trace spans. | 675 * cross-trace spans. |
674 */ | 676 */ |
675 core.String name; | 677 core.String name; |
676 /** ID of parent span. 0 or missing if this is a root span. */ | 678 /** |
| 679 * ID of the parent span. If this is a root span, the value must be `0` or |
| 680 * empty. |
| 681 */ |
677 core.String parentId; | 682 core.String parentId; |
678 /** Stack trace captured at the start of the span. This is optional. */ | 683 /** Stack trace captured at the start of the span. */ |
679 StackTrace stackTrace; | 684 StackTrace stackTrace; |
680 /** The final status of the Span. This is optional. */ | 685 /** An optional final status for this span. */ |
681 Status status; | 686 Status status; |
682 /** A collection of time-stamped events. */ | 687 /** |
| 688 * A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation |
| 689 * on the span, consisting of either user-supplied key:value pairs, or |
| 690 * details of an RPC message sent/received on the network. |
| 691 */ |
683 core.List<TimeEvent> timeEvents; | 692 core.List<TimeEvent> timeEvents; |
684 | 693 |
685 Span(); | 694 Span(); |
686 | 695 |
687 Span.fromJson(core.Map _json) { | 696 Span.fromJson(core.Map _json) { |
688 if (_json.containsKey("attributes")) { | 697 if (_json.containsKey("attributes")) { |
689 attributes = commons.mapMap(_json["attributes"], (item) => new AttributeVa
lue.fromJson(item)); | 698 attributes = commons.mapMap(_json["attributes"], (item) => new AttributeVa
lue.fromJson(item)); |
690 } | 699 } |
691 if (_json.containsKey("hasRemoteParent")) { | 700 if (_json.containsKey("hasRemoteParent")) { |
692 hasRemoteParent = _json["hasRemoteParent"]; | 701 hasRemoteParent = _json["hasRemoteParent"]; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 | 783 |
775 core.Map toJson() { | 784 core.Map toJson() { |
776 var _json = new core.Map(); | 785 var _json = new core.Map(); |
777 if (spans != null) { | 786 if (spans != null) { |
778 _json["spans"] = spans.map((value) => (value).toJson()).toList(); | 787 _json["spans"] = spans.map((value) => (value).toJson()).toList(); |
779 } | 788 } |
780 return _json; | 789 return _json; |
781 } | 790 } |
782 } | 791 } |
783 | 792 |
784 /** Presents a single stack frame in a stack trace. */ | 793 /** Represents a single stack frame in a stack trace. */ |
785 class StackFrame { | 794 class StackFrame { |
786 /** | 795 /** |
787 * Column number is important in JavaScript(anonymous functions), | 796 * Column number is important in JavaScript (anonymous functions). |
788 * Might not be available in some languages. | 797 * May not be available in some languages. |
789 */ | 798 */ |
790 core.String columnNumber; | 799 core.String columnNumber; |
791 /** File name of the frame. */ | 800 /** The filename of the file containing this frame. */ |
792 core.String fileName; | 801 core.String fileName; |
793 /** Fully qualified names which uniquely identify function/method/etc. */ | 802 /** |
| 803 * The fully-qualified name that uniquely identifies this function or |
| 804 * method. |
| 805 */ |
794 core.String functionName; | 806 core.String functionName; |
795 /** Line number of the frame. */ | 807 /** Line number of the frame. */ |
796 core.String lineNumber; | 808 core.String lineNumber; |
797 /** Binary module the code is loaded from. */ | 809 /** Binary module the code is loaded from. */ |
798 Module loadModule; | 810 Module loadModule; |
799 /** | 811 /** |
800 * Used when function name is ‘mangled’. Not guaranteed to be fully | 812 * Used when the function name is |
801 * qualified but usually it is. | 813 * [mangled](http://www.avabodh.com/cxxin/namemangling.html). May be |
| 814 * fully-qualified. |
802 */ | 815 */ |
803 core.String originalFunctionName; | 816 core.String originalFunctionName; |
804 /** | 817 /** The version of the deployed source code. */ |
805 * source_version is deployment specific. It might be | |
806 * better to be stored in deployment metadata. | |
807 */ | |
808 core.String sourceVersion; | 818 core.String sourceVersion; |
809 | 819 |
810 StackFrame(); | 820 StackFrame(); |
811 | 821 |
812 StackFrame.fromJson(core.Map _json) { | 822 StackFrame.fromJson(core.Map _json) { |
813 if (_json.containsKey("columnNumber")) { | 823 if (_json.containsKey("columnNumber")) { |
814 columnNumber = _json["columnNumber"]; | 824 columnNumber = _json["columnNumber"]; |
815 } | 825 } |
816 if (_json.containsKey("fileName")) { | 826 if (_json.containsKey("fileName")) { |
817 fileName = _json["fileName"]; | 827 fileName = _json["fileName"]; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 } | 868 } |
859 return _json; | 869 return _json; |
860 } | 870 } |
861 } | 871 } |
862 | 872 |
863 /** StackTrace collected in a trace. */ | 873 /** StackTrace collected in a trace. */ |
864 class StackTrace { | 874 class StackTrace { |
865 /** Stack frames of this stack trace. */ | 875 /** Stack frames of this stack trace. */ |
866 core.List<StackFrame> stackFrame; | 876 core.List<StackFrame> stackFrame; |
867 /** | 877 /** |
868 * User can choose to use their own hash function to hash large attributes to | 878 * The hash ID is used to conserve network bandwidth for duplicate |
869 * save network bandwidth and storage. | 879 * stack traces within a single trace. |
870 * Typical usage is to pass both stack_frame and stack_trace_hash_id initially | 880 * |
871 * to inform the storage of the mapping. And in subsequent calls, pass in | 881 * Often multiple spans will have identical stack traces. |
872 * stack_trace_hash_id only. User shall verify the hash value is | 882 * The first occurance of a stack trace should contain both the |
873 * successfully stored. | 883 * `stackFrame` content and a value in `stackTraceHashId`. |
| 884 * |
| 885 * Subsequent spans within the same request can refer |
| 886 * to that stack trace by only setting `stackTraceHashId`. |
874 */ | 887 */ |
875 core.String stackTraceHashId; | 888 core.String stackTraceHashId; |
876 | 889 |
877 StackTrace(); | 890 StackTrace(); |
878 | 891 |
879 StackTrace.fromJson(core.Map _json) { | 892 StackTrace.fromJson(core.Map _json) { |
880 if (_json.containsKey("stackFrame")) { | 893 if (_json.containsKey("stackFrame")) { |
881 stackFrame = _json["stackFrame"].map((value) => new StackFrame.fromJson(va
lue)).toList(); | 894 stackFrame = _json["stackFrame"].map((value) => new StackFrame.fromJson(va
lue)).toList(); |
882 } | 895 } |
883 if (_json.containsKey("stackTraceHashId")) { | 896 if (_json.containsKey("stackTraceHashId")) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 } | 1008 } |
996 if (message != null) { | 1009 if (message != null) { |
997 _json["message"] = message; | 1010 _json["message"] = message; |
998 } | 1011 } |
999 return _json; | 1012 return _json; |
1000 } | 1013 } |
1001 } | 1014 } |
1002 | 1015 |
1003 /** A time-stamped annotation in the Span. */ | 1016 /** A time-stamped annotation in the Span. */ |
1004 class TimeEvent { | 1017 class TimeEvent { |
1005 /** Optional field for user supplied <string, AttributeValue> map */ | 1018 /** One or more key:value pairs. */ |
1006 Annotation annotation; | 1019 Annotation annotation; |
1007 /** The local machine absolute timestamp when this event happened. */ | 1020 /** The timestamp indicating the time the event occurred. */ |
1008 core.String localTime; | 1021 core.String localTime; |
1009 /** Optional field that can be used only for network events. */ | 1022 /** An event describing an RPC message sent/received on the network. */ |
1010 NetworkEvent networkEvent; | 1023 NetworkEvent networkEvent; |
1011 | 1024 |
1012 TimeEvent(); | 1025 TimeEvent(); |
1013 | 1026 |
1014 TimeEvent.fromJson(core.Map _json) { | 1027 TimeEvent.fromJson(core.Map _json) { |
1015 if (_json.containsKey("annotation")) { | 1028 if (_json.containsKey("annotation")) { |
1016 annotation = new Annotation.fromJson(_json["annotation"]); | 1029 annotation = new Annotation.fromJson(_json["annotation"]); |
1017 } | 1030 } |
1018 if (_json.containsKey("localTime")) { | 1031 if (_json.containsKey("localTime")) { |
1019 localTime = _json["localTime"]; | 1032 localTime = _json["localTime"]; |
(...skipping 13 matching lines...) Expand all Loading... |
1033 } | 1046 } |
1034 if (networkEvent != null) { | 1047 if (networkEvent != null) { |
1035 _json["networkEvent"] = (networkEvent).toJson(); | 1048 _json["networkEvent"] = (networkEvent).toJson(); |
1036 } | 1049 } |
1037 return _json; | 1050 return _json; |
1038 } | 1051 } |
1039 } | 1052 } |
1040 | 1053 |
1041 /** | 1054 /** |
1042 * A trace describes how long it takes for an application to perform some | 1055 * A trace describes how long it takes for an application to perform some |
1043 * operations. It consists of a set of spans, each of which contains details | 1056 * operations. It consists of a set of spans, each representing |
1044 * about an operation with time information and operation details. | 1057 * an operation and including time information and operation details. |
1045 */ | 1058 */ |
1046 class Trace { | 1059 class Trace { |
1047 /** | 1060 /** |
1048 * ID of the trace which is "projects/<project_id>/traces/<trace_id>". | 1061 * A globally unique identifier for the trace in the format |
1049 * trace_id is globally unique identifier for the trace. Common to all the | 1062 * `projects/PROJECT_NUMBER/traces/TRACE_ID`. `TRACE_ID` is a base16-encoded |
1050 * spans. It is conceptually a 128-bit hex-encoded value. | 1063 * string of a 128-bit number and is required to be 32 char long. |
1051 */ | 1064 */ |
1052 core.String name; | 1065 core.String name; |
1053 | 1066 |
1054 Trace(); | 1067 Trace(); |
1055 | 1068 |
1056 Trace.fromJson(core.Map _json) { | 1069 Trace.fromJson(core.Map _json) { |
1057 if (_json.containsKey("name")) { | 1070 if (_json.containsKey("name")) { |
1058 name = _json["name"]; | 1071 name = _json["name"]; |
1059 } | 1072 } |
1060 } | 1073 } |
1061 | 1074 |
1062 core.Map toJson() { | 1075 core.Map toJson() { |
1063 var _json = new core.Map(); | 1076 var _json = new core.Map(); |
1064 if (name != null) { | 1077 if (name != null) { |
1065 _json["name"] = name; | 1078 _json["name"] = name; |
1066 } | 1079 } |
1067 return _json; | 1080 return _json; |
1068 } | 1081 } |
1069 } | 1082 } |
OLD | NEW |