blob: fb5a6f19c09860f8fd32238528533a4c3f0b8fe1 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
Dan O'Mearadd494642020-05-01 07:42:23 -070075<h1><a href="cloudtrace_v2.html">Cloud Trace API</a> . <a href="cloudtrace_v2.projects.html">projects</a> . <a href="cloudtrace_v2.projects.traces.html">traces</a></h1>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070076<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="cloudtrace_v2.projects.traces.spans.html">spans()</a></code>
79</p>
80<p class="firstline">Returns the spans Resource.</p>
81
82<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070083 <code><a href="#batchWrite">batchWrite(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070084<p class="firstline">Sends new spans to new or existing traces. You cannot update</p>
85<h3>Method Details</h3>
86<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code class="details" id="batchWrite">batchWrite(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070088 <pre>Sends new spans to new or existing traces. You cannot update
89existing spans.
Dan O'Mearadd494642020-05-01 07:42:23 -070090In this case, writing traces is not considered an active developer
91method since traces are machine generated.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070092
93Args:
94 name: string, Required. The name of the project where the spans belong. The format is
95`projects/[PROJECT_ID]`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -070096 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097 The object takes the form of:
98
99{ # The request message for the `BatchWriteSpans` method.
Dan O'Mearadd494642020-05-01 07:42:23 -0700100 "spans": [ # Required. A list of new spans. The span names must not match existing
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700101 # spans, or the results are undefined.
102 { # A span represents a single operation within a trace. Spans can be
103 # nested to form a trace tree. Often, a trace contains a root span
104 # that describes the end-to-end latency, and one or more subspans for
105 # its sub-operations. A trace can also contain multiple root spans,
Dan O'Mearadd494642020-05-01 07:42:23 -0700106 # or none at all. Spans do not need to be contiguous&amp;mdash;there may be
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700107 # gaps or overlaps between spans in a trace.
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 "status": { # The `Status` type defines a logical error model that is suitable for # Optional. The final status for this span.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109 # different programming environments, including REST APIs and RPC APIs. It is
110 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
111 # three pieces of data: error code, error message, and error details.
112 #
113 # You can find out more about this error model and how to work with it in the
114 # [API Design Guide](https://cloud.google.com/apis/design/errors).
115 "message": "A String", # A developer-facing error message, which should be in English. Any
116 # user-facing error message should be localized and sent in the
117 # google.rpc.Status.details field, or localized by the client.
118 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
119 "details": [ # A list of messages that carry the error details. There is a common set of
120 # message types for APIs to use.
121 {
122 "a_key": "", # Properties of the object. Contains field @type with type URL.
123 },
124 ],
125 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700126 "childSpanCount": 42, # Optional. The number of child spans that were generated while this span
127 # was active. If set, allows implementation to detect missing child spans.
128 "displayName": { # Represents a string that might be shortened to a specified length. # Required. A description of the span's operation (up to 128 bytes).
129 # Stackdriver Trace displays the description in the
130 # Google Cloud Platform Console.
131 # For example, the display name can be a qualified method name or a file name
132 # and a line number where the operation is called. A best practice is to use
133 # the same display name within an application and at the same call point.
134 # This makes it easier to correlate spans in different traces.
135 "value": "A String", # The shortened string. For example, if the original string is 500
136 # bytes long and the limit of the string is 128 bytes, then
137 # `value` contains the first 128 bytes of the 500-byte string.
138 #
139 # Truncation always happens on a UTF8 character boundary. If there
140 # are multi-byte characters in the string, then the length of the
141 # shortened string might be less than the size limit.
142 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
143 # value is 0, then the string was not shortened.
144 },
145 "name": "A String", # The resource name of the span in the following format:
146 #
147 # projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project;
148 # it is a 32-character hexadecimal encoding of a 16-byte array.
149 #
150 # [SPAN_ID] is a unique identifier for a span within a trace; it
151 # is a 16-character hexadecimal encoding of an 8-byte array.
152 "links": { # A collection of links, which are references from this span to a span # Links associated with the span. You can have up to 128 links per Span.
153 # in the same or different trace.
154 "droppedLinksCount": 42, # The number of dropped links after the maximum size was enforced. If
155 # this value is 0, then no links were dropped.
156 "link": [ # A collection of links.
157 { # A pointer from the current span to another span in the same trace or in a
158 # different trace. For example, this can be used in batching operations,
159 # where a single batch handler processes multiple requests from different
160 # traces or when the handler receives a request from a different project.
161 "attributes": { # A set of attributes, each in the format `[KEY]:[VALUE]`. # A set of attributes on the link. You have have up to 32 attributes per
162 # link.
163 "droppedAttributesCount": 42, # The number of attributes that were discarded. Attributes can be discarded
164 # because their keys are too long or because there are too many attributes.
165 # If this value is 0 then all attributes are valid.
166 "attributeMap": { # The set of attributes. Each attribute's key can be up to 128 bytes
167 # long. The value can be a string up to 256 bytes, a signed 64-bit integer,
168 # or the Boolean values `true` and `false`. For example:
169 #
170 # "/instance_id": { "string_value": { "value": "my-instance" } }
171 # "/http/request_bytes": { "int_value": 300 }
172 # "abc.com/myattribute": { "bool_value": false }
173 "a_key": { # The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
174 "stringValue": { # Represents a string that might be shortened to a specified length. # A string up to 256 bytes long.
175 "value": "A String", # The shortened string. For example, if the original string is 500
176 # bytes long and the limit of the string is 128 bytes, then
177 # `value` contains the first 128 bytes of the 500-byte string.
178 #
179 # Truncation always happens on a UTF8 character boundary. If there
180 # are multi-byte characters in the string, then the length of the
181 # shortened string might be less than the size limit.
182 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
183 # value is 0, then the string was not shortened.
184 },
185 "intValue": "A String", # A 64-bit signed integer.
186 "boolValue": True or False, # A Boolean value represented by `true` or `false`.
187 },
188 },
189 },
190 "traceId": "A String", # The [TRACE_ID] for a trace within a project.
191 "type": "A String", # The relationship of the current span relative to the linked span.
192 "spanId": "A String", # The [SPAN_ID] for a span within a trace.
193 },
194 ],
195 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700196 "stackTrace": { # A call stack appearing in a trace. # Stack trace captured at the start of the span.
197 "stackTraceHashId": "A String", # The hash ID is used to conserve network bandwidth for duplicate
198 # stack traces within a single trace.
199 #
200 # Often multiple spans will have identical stack traces.
201 # The first occurrence of a stack trace should contain both the
202 # `stackFrame` content and a value in `stackTraceHashId`.
203 #
204 # Subsequent spans within the same request can refer
205 # to that stack trace by only setting `stackTraceHashId`.
206 "stackFrames": { # A collection of stack frames, which can be truncated. # Stack frames in this stack trace. A maximum of 128 frames are allowed.
207 "frame": [ # Stack frames in this call stack.
208 { # Represents a single stack frame in a stack trace.
209 "columnNumber": "A String", # The column number where the function call appears, if available.
210 # This is important in JavaScript because of its anonymous functions.
211 "functionName": { # Represents a string that might be shortened to a specified length. # The fully-qualified name that uniquely identifies the function or
212 # method that is active in this frame (up to 1024 bytes).
213 "value": "A String", # The shortened string. For example, if the original string is 500
214 # bytes long and the limit of the string is 128 bytes, then
215 # `value` contains the first 128 bytes of the 500-byte string.
216 #
217 # Truncation always happens on a UTF8 character boundary. If there
218 # are multi-byte characters in the string, then the length of the
219 # shortened string might be less than the size limit.
220 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
221 # value is 0, then the string was not shortened.
222 },
223 "fileName": { # Represents a string that might be shortened to a specified length. # The name of the source file where the function call appears (up to 256
224 # bytes).
225 "value": "A String", # The shortened string. For example, if the original string is 500
226 # bytes long and the limit of the string is 128 bytes, then
227 # `value` contains the first 128 bytes of the 500-byte string.
228 #
229 # Truncation always happens on a UTF8 character boundary. If there
230 # are multi-byte characters in the string, then the length of the
231 # shortened string might be less than the size limit.
232 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
233 # value is 0, then the string was not shortened.
234 },
235 "sourceVersion": { # Represents a string that might be shortened to a specified length. # The version of the deployed source code (up to 128 bytes).
236 "value": "A String", # The shortened string. For example, if the original string is 500
237 # bytes long and the limit of the string is 128 bytes, then
238 # `value` contains the first 128 bytes of the 500-byte string.
239 #
240 # Truncation always happens on a UTF8 character boundary. If there
241 # are multi-byte characters in the string, then the length of the
242 # shortened string might be less than the size limit.
243 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
244 # value is 0, then the string was not shortened.
245 },
246 "loadModule": { # Binary module. # The binary module from where the code was loaded.
247 "buildId": { # Represents a string that might be shortened to a specified length. # A unique identifier for the module, usually a hash of its
248 # contents (up to 128 bytes).
249 "value": "A String", # The shortened string. For example, if the original string is 500
250 # bytes long and the limit of the string is 128 bytes, then
251 # `value` contains the first 128 bytes of the 500-byte string.
252 #
253 # Truncation always happens on a UTF8 character boundary. If there
254 # are multi-byte characters in the string, then the length of the
255 # shortened string might be less than the size limit.
256 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
257 # value is 0, then the string was not shortened.
258 },
259 "module": { # Represents a string that might be shortened to a specified length. # For example: main binary, kernel modules, and dynamic libraries
260 # such as libc.so, sharedlib.so (up to 256 bytes).
261 "value": "A String", # The shortened string. For example, if the original string is 500
262 # bytes long and the limit of the string is 128 bytes, then
263 # `value` contains the first 128 bytes of the 500-byte string.
264 #
265 # Truncation always happens on a UTF8 character boundary. If there
266 # are multi-byte characters in the string, then the length of the
267 # shortened string might be less than the size limit.
268 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
269 # value is 0, then the string was not shortened.
270 },
271 },
272 "lineNumber": "A String", # The line number in `file_name` where the function call appears.
273 "originalFunctionName": { # Represents a string that might be shortened to a specified length. # An un-mangled function name, if `function_name` is
274 # [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can
275 # be fully-qualified (up to 1024 bytes).
276 "value": "A String", # The shortened string. For example, if the original string is 500
277 # bytes long and the limit of the string is 128 bytes, then
278 # `value` contains the first 128 bytes of the 500-byte string.
279 #
280 # Truncation always happens on a UTF8 character boundary. If there
281 # are multi-byte characters in the string, then the length of the
282 # shortened string might be less than the size limit.
283 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
284 # value is 0, then the string was not shortened.
285 },
286 },
287 ],
288 "droppedFramesCount": 42, # The number of stack frames that were dropped because there
289 # were too many stack frames.
290 # If this value is 0, then no stack frames were dropped.
291 },
292 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700293 "spanKind": "A String", # Distinguishes between spans generated in a particular context. For example,
294 # two spans with the same name may be distinguished using `CLIENT` (caller)
295 # and `SERVER` (callee) to identify an RPC call.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700296 "parentSpanId": "A String", # The [SPAN_ID] of this span's parent span. If this is a root span,
297 # then this field must be empty.
Dan O'Mearadd494642020-05-01 07:42:23 -0700298 "startTime": "A String", # Required. The start time of the span. On the client side, this is the time kept by
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700299 # the local machine where the span execution starts. On the server side, this
300 # is the time when the server's application handler starts running.
Dan O'Mearadd494642020-05-01 07:42:23 -0700301 "spanId": "A String", # Required. The [SPAN_ID] portion of the span's resource name.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700302 "attributes": { # A set of attributes, each in the format `[KEY]:[VALUE]`. # A set of attributes on the span. You can have up to 32 attributes per
303 # span.
304 "droppedAttributesCount": 42, # The number of attributes that were discarded. Attributes can be discarded
305 # because their keys are too long or because there are too many attributes.
306 # If this value is 0 then all attributes are valid.
307 "attributeMap": { # The set of attributes. Each attribute's key can be up to 128 bytes
308 # long. The value can be a string up to 256 bytes, a signed 64-bit integer,
309 # or the Boolean values `true` and `false`. For example:
310 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700311 # "/instance_id": { "string_value": { "value": "my-instance" } }
312 # "/http/request_bytes": { "int_value": 300 }
313 # "abc.com/myattribute": { "bool_value": false }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700314 "a_key": { # The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
315 "stringValue": { # Represents a string that might be shortened to a specified length. # A string up to 256 bytes long.
316 "value": "A String", # The shortened string. For example, if the original string is 500
317 # bytes long and the limit of the string is 128 bytes, then
318 # `value` contains the first 128 bytes of the 500-byte string.
319 #
320 # Truncation always happens on a UTF8 character boundary. If there
321 # are multi-byte characters in the string, then the length of the
322 # shortened string might be less than the size limit.
323 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
324 # value is 0, then the string was not shortened.
325 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700326 "intValue": "A String", # A 64-bit signed integer.
Dan O'Mearadd494642020-05-01 07:42:23 -0700327 "boolValue": True or False, # A Boolean value represented by `true` or `false`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700328 },
329 },
330 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700331 "timeEvents": { # A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation # A set of time events. You can have up to 32 annotations and 128 message
332 # events per span.
333 # on the span, consisting of either user-supplied key:value pairs, or
334 # details of a message sent/received between Spans.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700335 "timeEvent": [ # A collection of `TimeEvent`s.
336 { # A time-stamped annotation or message event in the Span.
337 "messageEvent": { # An event describing a message sent/received between Spans. # An event describing a message sent/received between Spans.
338 "uncompressedSizeBytes": "A String", # The number of uncompressed bytes sent or received.
339 "type": "A String", # Type of MessageEvent. Indicates whether the message was sent or
340 # received.
341 "id": "A String", # An identifier for the MessageEvent's message that can be used to match
342 # SENT and RECEIVED MessageEvents. It is recommended to be unique within
343 # a Span.
344 "compressedSizeBytes": "A String", # The number of compressed bytes sent or received. If missing assumed to
345 # be the same size as uncompressed.
346 },
347 "annotation": { # Text annotation with a set of attributes. # Text annotation with a set of attributes.
348 "attributes": { # A set of attributes, each in the format `[KEY]:[VALUE]`. # A set of attributes on the annotation. You can have up to 4 attributes
349 # per Annotation.
350 "droppedAttributesCount": 42, # The number of attributes that were discarded. Attributes can be discarded
351 # because their keys are too long or because there are too many attributes.
352 # If this value is 0 then all attributes are valid.
353 "attributeMap": { # The set of attributes. Each attribute's key can be up to 128 bytes
354 # long. The value can be a string up to 256 bytes, a signed 64-bit integer,
355 # or the Boolean values `true` and `false`. For example:
356 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700357 # "/instance_id": { "string_value": { "value": "my-instance" } }
358 # "/http/request_bytes": { "int_value": 300 }
359 # "abc.com/myattribute": { "bool_value": false }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700360 "a_key": { # The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
361 "stringValue": { # Represents a string that might be shortened to a specified length. # A string up to 256 bytes long.
362 "value": "A String", # The shortened string. For example, if the original string is 500
363 # bytes long and the limit of the string is 128 bytes, then
364 # `value` contains the first 128 bytes of the 500-byte string.
365 #
366 # Truncation always happens on a UTF8 character boundary. If there
367 # are multi-byte characters in the string, then the length of the
368 # shortened string might be less than the size limit.
369 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
370 # value is 0, then the string was not shortened.
371 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700372 "intValue": "A String", # A 64-bit signed integer.
Dan O'Mearadd494642020-05-01 07:42:23 -0700373 "boolValue": True or False, # A Boolean value represented by `true` or `false`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700374 },
375 },
376 },
377 "description": { # Represents a string that might be shortened to a specified length. # A user-supplied message describing the event. The maximum length for
378 # the description is 256 bytes.
379 "value": "A String", # The shortened string. For example, if the original string is 500
380 # bytes long and the limit of the string is 128 bytes, then
381 # `value` contains the first 128 bytes of the 500-byte string.
382 #
383 # Truncation always happens on a UTF8 character boundary. If there
384 # are multi-byte characters in the string, then the length of the
385 # shortened string might be less than the size limit.
386 "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
387 # value is 0, then the string was not shortened.
388 },
389 },
390 "time": "A String", # The timestamp indicating the time the event occurred.
391 },
392 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700393 "droppedMessageEventsCount": 42, # The number of dropped message events in all the included time events.
394 # If the value is 0, then no message events were dropped.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700395 "droppedAnnotationsCount": 42, # The number of dropped annotations in all the included time events.
396 # If the value is 0, then no annotations were dropped.
397 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700398 "endTime": "A String", # Required. The end time of the span. On the client side, this is the time kept by
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700399 # the local machine where the span execution ends. On the server side, this
400 # is the time when the server application handler stops running.
Dan O'Mearadd494642020-05-01 07:42:23 -0700401 "sameProcessAsParentSpan": True or False, # Optional. Set this parameter to indicate whether this span is in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700402 # the same process as its parent. If you do not set this parameter,
403 # Stackdriver Trace is unable to take advantage of this helpful
404 # information.
405 },
406 ],
407 }
408
409 x__xgafv: string, V1 error format.
410 Allowed values
411 1 - v1 error format
412 2 - v2 error format
413
414Returns:
415 An object of the form:
416
417 { # A generic empty message that you can re-use to avoid defining duplicated
418 # empty messages in your APIs. A typical example is to use it as the request
419 # or the response type of an API method. For instance:
420 #
421 # service Foo {
422 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
423 # }
424 #
425 # The JSON representation for `Empty` is empty JSON object `{}`.
426 }</pre>
427</div>
428
429</body></html>