• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<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
75<h1><a href="cloudtrace_v2.html">Stackdriver Trace API</a> . <a href="cloudtrace_v2.projects.html">projects</a> . <a href="cloudtrace_v2.projects.traces.html">traces</a></h1>
76<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">
83  <code><a href="#batchWrite">batchWrite(name, body, x__xgafv=None)</a></code></p>
84<p class="firstline">Sends new spans to new or existing traces. You cannot update</p>
85<h3>Method Details</h3>
86<div class="method">
87    <code class="details" id="batchWrite">batchWrite(name, body, x__xgafv=None)</code>
88  <pre>Sends new spans to new or existing traces. You cannot update
89existing spans.
90
91Args:
92  name: string, Required. The name of the project where the spans belong. The format is
93`projects/[PROJECT_ID]`. (required)
94  body: object, The request body. (required)
95    The object takes the form of:
96
97{ # The request message for the `BatchWriteSpans` method.
98    "spans": [ # A list of new spans. The span names must not match existing
99        # spans, or the results are undefined.
100      { # A span represents a single operation within a trace. Spans can be
101          # nested to form a trace tree. Often, a trace contains a root span
102          # that describes the end-to-end latency, and one or more subspans for
103          # its sub-operations. A trace can also contain multiple root spans,
104          # or none at all. Spans do not need to be contiguous&mdash;there may be
105          # gaps or overlaps between spans in a trace.
106        "status": { # The `Status` type defines a logical error model that is suitable for # An optional final status for this span.
107            # different programming environments, including REST APIs and RPC APIs. It is
108            # used by [gRPC](https://github.com/grpc). Each `Status` message contains
109            # three pieces of data: error code, error message, and error details.
110            #
111            # You can find out more about this error model and how to work with it in the
112            # [API Design Guide](https://cloud.google.com/apis/design/errors).
113          "message": "A String", # A developer-facing error message, which should be in English. Any
114              # user-facing error message should be localized and sent in the
115              # google.rpc.Status.details field, or localized by the client.
116          "code": 42, # The status code, which should be an enum value of google.rpc.Code.
117          "details": [ # A list of messages that carry the error details.  There is a common set of
118              # message types for APIs to use.
119            {
120              "a_key": "", # Properties of the object. Contains field @type with type URL.
121            },
122          ],
123        },
124        "stackTrace": { # A call stack appearing in a trace. # Stack trace captured at the start of the span.
125          "stackTraceHashId": "A String", # The hash ID is used to conserve network bandwidth for duplicate
126              # stack traces within a single trace.
127              #
128              # Often multiple spans will have identical stack traces.
129              # The first occurrence of a stack trace should contain both the
130              # `stackFrame` content and a value in `stackTraceHashId`.
131              #
132              # Subsequent spans within the same request can refer
133              # to that stack trace by only setting `stackTraceHashId`.
134          "stackFrames": { # A collection of stack frames, which can be truncated. # Stack frames in this stack trace. A maximum of 128 frames are allowed.
135            "frame": [ # Stack frames in this call stack.
136              { # Represents a single stack frame in a stack trace.
137                "columnNumber": "A String", # The column number where the function call appears, if available.
138                    # This is important in JavaScript because of its anonymous functions.
139                "functionName": { # Represents a string that might be shortened to a specified length. # The fully-qualified name that uniquely identifies the function or
140                    # method that is active in this frame (up to 1024 bytes).
141                  "value": "A String", # The shortened string. For example, if the original string is 500
142                      # bytes long and the limit of the string is 128 bytes, then
143                      # `value` contains the first 128 bytes of the 500-byte string.
144                      #
145                      # Truncation always happens on a UTF8 character boundary. If there
146                      # are multi-byte characters in the string, then the length of the
147                      # shortened string might be less than the size limit.
148                  "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
149                      # value is 0, then the string was not shortened.
150                },
151                "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
152                    # bytes).
153                  "value": "A String", # The shortened string. For example, if the original string is 500
154                      # bytes long and the limit of the string is 128 bytes, then
155                      # `value` contains the first 128 bytes of the 500-byte string.
156                      #
157                      # Truncation always happens on a UTF8 character boundary. If there
158                      # are multi-byte characters in the string, then the length of the
159                      # shortened string might be less than the size limit.
160                  "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
161                      # value is 0, then the string was not shortened.
162                },
163                "sourceVersion": { # Represents a string that might be shortened to a specified length. # The version of the deployed source code (up to 128 bytes).
164                  "value": "A String", # The shortened string. For example, if the original string is 500
165                      # bytes long and the limit of the string is 128 bytes, then
166                      # `value` contains the first 128 bytes of the 500-byte string.
167                      #
168                      # Truncation always happens on a UTF8 character boundary. If there
169                      # are multi-byte characters in the string, then the length of the
170                      # shortened string might be less than the size limit.
171                  "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
172                      # value is 0, then the string was not shortened.
173                },
174                "loadModule": { # Binary module. # The binary module from where the code was loaded.
175                  "buildId": { # Represents a string that might be shortened to a specified length. # A unique identifier for the module, usually a hash of its
176                      # contents (up to 128 bytes).
177                    "value": "A String", # The shortened string. For example, if the original string is 500
178                        # bytes long and the limit of the string is 128 bytes, then
179                        # `value` contains the first 128 bytes of the 500-byte string.
180                        #
181                        # Truncation always happens on a UTF8 character boundary. If there
182                        # are multi-byte characters in the string, then the length of the
183                        # shortened string might be less than the size limit.
184                    "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
185                        # value is 0, then the string was not shortened.
186                  },
187                  "module": { # Represents a string that might be shortened to a specified length. # For example: main binary, kernel modules, and dynamic libraries
188                      # such as libc.so, sharedlib.so (up to 256 bytes).
189                    "value": "A String", # The shortened string. For example, if the original string is 500
190                        # bytes long and the limit of the string is 128 bytes, then
191                        # `value` contains the first 128 bytes of the 500-byte string.
192                        #
193                        # Truncation always happens on a UTF8 character boundary. If there
194                        # are multi-byte characters in the string, then the length of the
195                        # shortened string might be less than the size limit.
196                    "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
197                        # value is 0, then the string was not shortened.
198                  },
199                },
200                "lineNumber": "A String", # The line number in `file_name` where the function call appears.
201                "originalFunctionName": { # Represents a string that might be shortened to a specified length. # An un-mangled function name, if `function_name` is
202                    # [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can
203                    # be fully-qualified (up to 1024 bytes).
204                  "value": "A String", # The shortened string. For example, if the original string is 500
205                      # bytes long and the limit of the string is 128 bytes, then
206                      # `value` contains the first 128 bytes of the 500-byte string.
207                      #
208                      # Truncation always happens on a UTF8 character boundary. If there
209                      # are multi-byte characters in the string, then the length of the
210                      # shortened string might be less than the size limit.
211                  "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
212                      # value is 0, then the string was not shortened.
213                },
214              },
215            ],
216            "droppedFramesCount": 42, # The number of stack frames that were dropped because there
217                # were too many stack frames.
218                # If this value is 0, then no stack frames were dropped.
219          },
220        },
221        "displayName": { # Represents a string that might be shortened to a specified length. # A description of the span's operation (up to 128 bytes).
222            # Stackdriver Trace displays the description in the
223            # Google Cloud Platform Console.
224            # For example, the display name can be a qualified method name or a file name
225            # and a line number where the operation is called. A best practice is to use
226            # the same display name within an application and at the same call point.
227            # This makes it easier to correlate spans in different traces.
228          "value": "A String", # The shortened string. For example, if the original string is 500
229              # bytes long and the limit of the string is 128 bytes, then
230              # `value` contains the first 128 bytes of the 500-byte string.
231              #
232              # Truncation always happens on a UTF8 character boundary. If there
233              # are multi-byte characters in the string, then the length of the
234              # shortened string might be less than the size limit.
235          "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
236              # value is 0, then the string was not shortened.
237        },
238        "name": "A String", # The resource name of the span in the following format:
239            #
240            #     projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project;
241            # it is a 32-character hexadecimal encoding of a 16-byte array.
242            #
243            # [SPAN_ID] is a unique identifier for a span within a trace; it
244            # is a 16-character hexadecimal encoding of an 8-byte array.
245        "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.
246            # in the same or different trace.
247          "droppedLinksCount": 42, # The number of dropped links after the maximum size was enforced. If
248              # this value is 0, then no links were dropped.
249          "link": [ # A collection of links.
250            { # A pointer from the current span to another span in the same trace or in a
251                # different trace. For example, this can be used in batching operations,
252                # where a single batch handler processes multiple requests from different
253                # traces or when the handler receives a request from a different project.
254              "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
255                  # link.
256                "droppedAttributesCount": 42, # The number of attributes that were discarded. Attributes can be discarded
257                    # because their keys are too long or because there are too many attributes.
258                    # If this value is 0 then all attributes are valid.
259                "attributeMap": { # The set of attributes. Each attribute's key can be up to 128 bytes
260                    # long. The value can be a string up to 256 bytes, a signed 64-bit integer,
261                    # or the Boolean values `true` and `false`. For example:
262                    #
263                    #     "/instance_id": "my-instance"
264                    #     "/http/user_agent": ""
265                    #     "/http/request_bytes": 300
266                    #     "abc.com/myattribute": true
267                  "a_key": { # The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
268                    "stringValue": { # Represents a string that might be shortened to a specified length. # A string up to 256 bytes long.
269                      "value": "A String", # The shortened string. For example, if the original string is 500
270                          # bytes long and the limit of the string is 128 bytes, then
271                          # `value` contains the first 128 bytes of the 500-byte string.
272                          #
273                          # Truncation always happens on a UTF8 character boundary. If there
274                          # are multi-byte characters in the string, then the length of the
275                          # shortened string might be less than the size limit.
276                      "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
277                          # value is 0, then the string was not shortened.
278                    },
279                    "boolValue": True or False, # A Boolean value represented by `true` or `false`.
280                    "intValue": "A String", # A 64-bit signed integer.
281                  },
282                },
283              },
284              "traceId": "A String", # The [TRACE_ID] for a trace within a project.
285              "type": "A String", # The relationship of the current span relative to the linked span.
286              "spanId": "A String", # The [SPAN_ID] for a span within a trace.
287            },
288          ],
289        },
290        "childSpanCount": 42, # An optional number of child spans that were generated while this span
291            # was active. If set, allows implementation to detect missing child spans.
292        "parentSpanId": "A String", # The [SPAN_ID] of this span's parent span. If this is a root span,
293            # then this field must be empty.
294        "startTime": "A String", # The start time of the span. On the client side, this is the time kept by
295            # the local machine where the span execution starts. On the server side, this
296            # is the time when the server's application handler starts running.
297        "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
298            # span.
299          "droppedAttributesCount": 42, # The number of attributes that were discarded. Attributes can be discarded
300              # because their keys are too long or because there are too many attributes.
301              # If this value is 0 then all attributes are valid.
302          "attributeMap": { # The set of attributes. Each attribute's key can be up to 128 bytes
303              # long. The value can be a string up to 256 bytes, a signed 64-bit integer,
304              # or the Boolean values `true` and `false`. For example:
305              #
306              #     "/instance_id": "my-instance"
307              #     "/http/user_agent": ""
308              #     "/http/request_bytes": 300
309              #     "abc.com/myattribute": true
310            "a_key": { # The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
311              "stringValue": { # Represents a string that might be shortened to a specified length. # A string up to 256 bytes long.
312                "value": "A String", # The shortened string. For example, if the original string is 500
313                    # bytes long and the limit of the string is 128 bytes, then
314                    # `value` contains the first 128 bytes of the 500-byte string.
315                    #
316                    # Truncation always happens on a UTF8 character boundary. If there
317                    # are multi-byte characters in the string, then the length of the
318                    # shortened string might be less than the size limit.
319                "truncatedByteCount": 42, # The number of bytes removed from the original string. If this
320                    # value is 0, then the string was not shortened.
321              },
322              "boolValue": True or False, # A Boolean value represented by `true` or `false`.
323              "intValue": "A String", # A 64-bit signed integer.
324            },
325          },
326        },
327        "spanId": "A String", # The [SPAN_ID] portion of the span's resource name.
328        "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
329            # events per span.
330            # on the span, consisting of either user-supplied key:value pairs, or
331            # details of a message sent/received between Spans.
332          "droppedMessageEventsCount": 42, # The number of dropped message events in all the included time events.
333              # If the value is 0, then no message events were dropped.
334          "timeEvent": [ # A collection of `TimeEvent`s.
335            { # A time-stamped annotation or message event in the Span.
336              "messageEvent": { # An event describing a message sent/received between Spans. # An event describing a message sent/received between Spans.
337                "uncompressedSizeBytes": "A String", # The number of uncompressed bytes sent or received.
338                "type": "A String", # Type of MessageEvent. Indicates whether the message was sent or
339                    # received.
340                "id": "A String", # An identifier for the MessageEvent's message that can be used to match
341                    # SENT and RECEIVED MessageEvents. It is recommended to be unique within
342                    # a Span.
343                "compressedSizeBytes": "A String", # The number of compressed bytes sent or received. If missing assumed to
344                    # be the same size as uncompressed.
345              },
346              "annotation": { # Text annotation with a set of attributes. # Text annotation with a set of attributes.
347                "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
348                    # per Annotation.
349                  "droppedAttributesCount": 42, # The number of attributes that were discarded. Attributes can be discarded
350                      # because their keys are too long or because there are too many attributes.
351                      # If this value is 0 then all attributes are valid.
352                  "attributeMap": { # The set of attributes. Each attribute's key can be up to 128 bytes
353                      # long. The value can be a string up to 256 bytes, a signed 64-bit integer,
354                      # or the Boolean values `true` and `false`. For example:
355                      #
356                      #     "/instance_id": "my-instance"
357                      #     "/http/user_agent": ""
358                      #     "/http/request_bytes": 300
359                      #     "abc.com/myattribute": true
360                    "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                      },
372                      "boolValue": True or False, # A Boolean value represented by `true` or `false`.
373                      "intValue": "A String", # A 64-bit signed integer.
374                    },
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          ],
393          "droppedAnnotationsCount": 42, # The number of dropped annotations in all the included time events.
394              # If the value is 0, then no annotations were dropped.
395        },
396        "endTime": "A String", # The end time of the span. On the client side, this is the time kept by
397            # the local machine where the span execution ends. On the server side, this
398            # is the time when the server application handler stops running.
399        "sameProcessAsParentSpan": True or False, # (Optional) Set this parameter to indicate whether this span is in
400            # the same process as its parent. If you do not set this parameter,
401            # Stackdriver Trace is unable to take advantage of this helpful
402            # information.
403      },
404    ],
405  }
406
407  x__xgafv: string, V1 error format.
408    Allowed values
409      1 - v1 error format
410      2 - v2 error format
411
412Returns:
413  An object of the form:
414
415    { # A generic empty message that you can re-use to avoid defining duplicated
416      # empty messages in your APIs. A typical example is to use it as the request
417      # or the response type of an API method. For instance:
418      #
419      #     service Foo {
420      #       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
421      #     }
422      #
423      # The JSON representation for `Empty` is empty JSON object `{}`.
424  }</pre>
425</div>
426
427</body></html>