spans
Creates, updates, deletes, gets or lists a spans
resource.
Overview
Name | spans |
Type | Resource |
Id | google.cloudtrace.spans |
Fields
The following fields are returned by SELECT
queries:
SELECT
not supported for this resource, use SHOW METHODS
to view available operations for the resource.
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
create_span | insert | projectsId , tracesId , spansId | Creates a new span. If a span ID already exists, an additional copy of the span will be stored. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
projectsId | string | |
spansId | string | |
tracesId | string |
INSERT
examples
- create_span
- Manifest
Creates a new span. If a span ID already exists, an additional copy of the span will be stored.
INSERT INTO google.cloudtrace.spans (
data__name,
data__spanId,
data__parentSpanId,
data__displayName,
data__startTime,
data__endTime,
data__attributes,
data__stackTrace,
data__timeEvents,
data__links,
data__status,
data__sameProcessAsParentSpan,
data__childSpanCount,
data__spanKind,
projectsId,
tracesId,
spansId
)
SELECT
'{{ name }}',
'{{ spanId }}',
'{{ parentSpanId }}',
'{{ displayName }}',
'{{ startTime }}',
'{{ endTime }}',
'{{ attributes }}',
'{{ stackTrace }}',
'{{ timeEvents }}',
'{{ links }}',
'{{ status }}',
{{ sameProcessAsParentSpan }},
{{ childSpanCount }},
'{{ spanKind }}',
'{{ projectsId }}',
'{{ tracesId }}',
'{{ spansId }}'
RETURNING
name,
attributes,
childSpanCount,
displayName,
endTime,
links,
parentSpanId,
sameProcessAsParentSpan,
spanId,
spanKind,
stackTrace,
startTime,
status,
timeEvents
;
# Description fields are for documentation purposes
- name: spans
props:
- name: projectsId
value: string
description: Required parameter for the spans resource.
- name: tracesId
value: string
description: Required parameter for the spans resource.
- name: spansId
value: string
description: Required parameter for the spans resource.
- name: name
value: string
description: >
Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero. .
- name: spanId
value: string
description: >
Required. The `[SPAN_ID]` portion of the span's resource name.
- name: parentSpanId
value: string
description: >
The `[SPAN_ID]` of this span's parent span. If this is a root span, then this field must be empty.
- name: displayName
value: object
description: >
Required. A description of the span's operation (up to 128 bytes). Cloud Trace displays the description in the Cloud console. For example, the display name can be a qualified method name or a file name and a line number where the operation is called. A best practice is to use the same display name within an application and at the same call point. This makes it easier to correlate spans in different traces.
- name: startTime
value: string
description: >
Required. The start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server's application handler starts running.
- name: endTime
value: string
description: >
Required. The end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running.
- name: attributes
value: object
description: >
A set of attributes on the span. You can have up to 32 attributes per span.
- name: stackTrace
value: object
description: >
Stack trace captured at the start of the span.
- name: timeEvents
value: object
description: >
A set of time events. You can have up to 32 annotations and 128 message events per span.
- name: links
value: object
description: >
Links associated with the span. You can have up to 128 links per Span.
- name: status
value: object
description: >
Optional. The final status for this span.
- name: sameProcessAsParentSpan
value: boolean
description: >
Optional. Set this parameter to indicate whether this span is in the same process as its parent. If you do not set this parameter, Trace is unable to take advantage of this helpful information.
- name: childSpanCount
value: integer
description: >
Optional. The number of child spans that were generated while this span was active. If set, allows implementation to detect missing child spans.
- name: spanKind
value: string
description: >
Optional. Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call.
valid_values: ['SPAN_KIND_UNSPECIFIED', 'INTERNAL', 'SERVER', 'CLIENT', 'PRODUCER', 'CONSUMER']