Project: Gloo (Orchestration & Management / API Gateway)
File: trace.proto.sk.md

title: "trace.proto" weight: 5 <!-- Code generated by solo-kit. DO NOT EDIT. --> Copyright 2017, OpenCensus Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. A span represents a single operation within a trace. Spans can be nested to form a trace tree. Often, a trace contains a root span that describes the end-to-end latency, and one or more subspans for its sub-operations. A trace can also contain multiple root spans, or none at all. Spans do not need to be contiguous - there may be gaps or overlaps between spans in a trace. The next id is 15. TODO(bdrutu): Add an example. ```yaml "traceId": bytes "spanId": bytes "parentSpanId": bytes "name": .opencensus.proto.trace.TruncatableString "kind": .opencensus.proto.trace.Span.SpanKind "startTime": .google.protobuf.Timestamp "endTime": .google.protobuf.Timestamp "attributes": .opencensus.proto.trace.Span.Attributes "stackTrace": .opencensus.proto.trace.StackTrace "timeEvents": .opencensus.proto.trace.Span.TimeEvents "links": .opencensus.proto.trace.Span.Links "status": .opencensus.proto.trace.Status "sameProcessAsParentSpan": .google.protobuf.BoolValue "childSpanCount": .google.protobuf.UInt32Value ``` | Field | Type | Description | | -- | - | -- | | `traceId` | `bytes` | A unique identifier for a trace. All spans from the same trace share the same `trace_id`. The ID is a 16-byte array. This field is required. | | `spanId` | `bytes` | A unique identifier for a span within a trace, assigned when the span is created. The ID is an 8-byte array. This field is required. | | `parentSpanId` | `bytes` | The `span_id` of this span's parent span. If this is a root span, then this field must be empty. The ID is an 8-byte array. | | `name` | | A description of the span's operation. For example, the 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 at the same call point in an application. This makes it easier to correlate spans in different traces. This field is required. | | `kind` | | Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `CLIENT` and `SERVER` to identify queueing latency associated with the span. | | `startTime` | | 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. | | `endTime` | | 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. | | `attributes` | | A set of attributes on the span. | | `stackTrace` | | A stack trace captured at the start of the span. | | `timeEvents` | | The included time events. | | `links` | | The inclued links. | | `status` | | An optional final status for this

| | `sameProcessAsParentSpan` | | A highly recommended but not required flag that identifies when a trace crosses a process boundary. True when the parent_span belongs to the same process as the current span. | | `childSpanCount` | | An optional number of child spans that were generated while this span was active. If set, allows an implementation to detect missing child spans. | A set of attributes, each with a key and a value. ```yaml "attributeMap": map<string, .opencensus.proto.trace.AttributeValue> "droppedAttributesCount": int ``` | Field | Type | Description | | -- | - | -- | | `attributeMap` | `map<string, .opencensus.proto.trace.AttributeValue>` | The set of attributes. The value can be a string, an integer, or the Boolean values `true` and `false`. For example: "/instanceid": "my-instance" "/http/useragent": "" "/http/server_latency": 300 "abc.com/myattribute": true. | | `droppedAttributesCount` | `int` | The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0, then no attributes were dropped. | A time-stamped annotation or message event in the Span. ```yaml "time": .google.protobuf.Timestamp "annotation": .opencensus.proto.trace.Span.TimeEvent.Annotation "messageEvent": .opencensus.proto.trace.Span.TimeEvent.MessageEvent ``` | Field | Type | Description | | -- | - | -- | | `time` | | The time the event occurred. | | `annotation` | | A text annotation with a set of attributes. Only one of `annotation` or `messageEvent` can be set. | | `messageEvent` | | An event describing a message sent/received between Spans. Only one of `messageEvent` or `annotation` can be set. | A text annotation with a set of attributes. ```yaml "description": .opencensus.proto.trace.TruncatableString "attributes": .opencensus.proto.trace.Span.Attributes ``` | Field | Type | Description | | -- | - | -- | | `description` | | A user-supplied message describing the event. | | `attributes` | | A set of attributes on the annotation. | An event describing a message sent/received between Spans. ```yaml "type": .opencensus.proto.trace.Span.TimeEvent.MessageEvent.Type "id": int "uncompressedSize": int "compressedSize": int ``` | Field | Type | Description | | -- | - | -- | | `type` | | The type of MessageEvent. Indicates whether the message was sent or received. | | `id` | `int` | An identifier for the MessageEvent's message that can be used to match SENT and RECEIVED MessageEvents. For example, this field could represent a sequence ID for a streaming RPC. It is recommended to be unique within a Span. | | `uncompressedSize` | `int` | The number of uncompressed bytes sent or received. | | `compressedSize` | `int` | The number of compressed bytes sent or received. If zero, assumed to be the same size as uncompressed. | Indicates whether the message was sent or received. | Name | Description | | -- | -- | | `TYPE_UNSPECIFIED` | Unknown event type. | | `SENT` | Indicates a sent message. | | `RECEIVED` | Indicates a received message. | A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation on the span, consisting of either user-supplied key-value pairs, or details of a message sent/received between Spans. ```yaml "timeEvent": []opencensus.proto.trace.Span.TimeEvent "droppedAnnotationsCount": int "droppedMessageEventsCount": int ``` | Field | Type | Description | | -- | - | -- | | `timeEvent` | | A collection of `TimeEvent`s. | | `droppedAnnotationsCount` | `int` | The number of dropped annotations in all the included time events. If the value is 0, then no annotations were

| | `droppedMessageEventsCount` | `int` | The number of dropped message events in all the included time events. If the value is 0, then no message events were dropped. | A pointer from the current span to another span in the same trace or in a different trace. For example, this can be used in batching operations, where a single batch handler processes multiple requests from different traces or when the handler receives a request from a different project. ```yaml "traceId": bytes "spanId": bytes "type": .opencensus.proto.trace.Span.Link.Type "attributes": .opencensus.proto.trace.Span.Attributes ``` | Field | Type | Description | | -- | - | -- | | `traceId` | `bytes` | A unique identifier for a trace. All spans from the same trace share the same `trace_id`. The ID is a 16-byte array. | | `spanId` | `bytes` | A unique identifier for a span within a trace, assigned when the span is created. The ID is an 8-byte array. | | `type` | | The relationship of the current span relative to the linked span. | | `attributes` | | A set of attributes on the link. | The relationship of the current span relative to the linked span: child, parent, or unspecified. | Name | Description | | -- | -- | | `TYPE_UNSPECIFIED` | The relationship of the two spans is unknown, or known but other than parent-child. | | `CHILDLINKEDSPAN` | The linked span is a child of the current span. | | `PARENTLINKEDSPAN` | The linked span is a parent of the current span. | A collection of links, which are references from this span to a span in the same or different trace. ```yaml "link": []opencensus.proto.trace.Span.Link "droppedLinksCount": int ``` | Field | Type | Description | | -- | - | -- | | `link` | | A collection of links. | | `droppedLinksCount` | `int` | The number of dropped links after the maximum size was enforced. If this value is 0, then no links were dropped. | Type of span. Can be used to specify additional relationships between spans in addition to a parent/child relationship. | Name | Description | | -- | -- | | `SPANKINDUNSPECIFIED` | Unspecified. | | `SERVER` | Indicates that the span covers server-side handling of an RPC or other remote network request. | | `CLIENT` | Indicates that the span covers the client-side wrapper around an RPC or other remote request. | The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. This proto's fields are a subset of those of , which is used by . ```yaml "code": int "message": string ``` | Field | Type | Description | | -- | - | -- | | `code` | `int` | The status code. | | `message` | `string` | A developer-facing error message, which should be in English. | The value of an Attribute. ```yaml "stringValue": .opencensus.proto.trace.TruncatableString "intValue": int "boolValue": bool ``` | Field | Type | Description | | -- | - | -- | | `stringValue` | | A string up to 256 bytes long. Only one of `stringValue`, `intValue`, or `boolValue` can be set. | | `intValue` | `int` | A 64-bit signed integer. Only one of `intValue`, `stringValue`, or `boolValue` can be set. | | `boolValue` | `bool` | A Boolean value represented by `true` or `false`. Only one of `boolValue`, `stringValue`, or `intValue` can be

| The call stack which originated this span. ```yaml "stackFrames": .opencensus.proto.trace.StackTrace.StackFrames "stackTraceHashId": int ``` | Field | Type | Description | | -- | - | -- | | `stackFrames` | | Stack frames in this stack trace. | | `stackTraceHashId` | `int` | The hash ID is used to conserve network bandwidth for duplicate stack traces within a single trace. Often multiple spans will have identical stack traces. The first occurrence of a stack trace should contain both `stackframes` and a value in `stacktracehashid`. Subsequent spans within the same request can refer to that stack trace by setting only `stacktracehashid`. TODO: describe how to deal with the case where stacktracehashid is zero because it was not set. | A single stack frame in a stack trace. ```yaml "functionName": .opencensus.proto.trace.TruncatableString "originalFunctionName": .opencensus.proto.trace.TruncatableString "fileName": .opencensus.proto.trace.TruncatableString "lineNumber": int "columnNumber": int "loadModule": .opencensus.proto.trace.Module "sourceVersion": .opencensus.proto.trace.TruncatableString ``` | Field | Type | Description | | -- | - | -- | | `functionName` | | The fully-qualified name that uniquely identifies the function or method that is active in this frame. | | `originalFunctionName` | | An un-mangled function name, if `function_name` is . The name can be fully qualified. | | `fileName` | | The name of the source file where the function call appears. | | `lineNumber` | `int` | The line number in `file_name` where the function call appears. | | `columnNumber` | `int` | The column number where the function call appears, if available. This is important in JavaScript because of its anonymous functions. | | `loadModule` | | The binary module from where the code was loaded. | | `sourceVersion` | | The version of the deployed source code. | A collection of stack frames, which can be truncated. ```yaml "frame": []opencensus.proto.trace.StackTrace.StackFrame "droppedFramesCount": int ``` | Field | Type | Description | | -- | - | -- | | `frame` | | Stack frames in this call stack. | | `droppedFramesCount` | `int` | The number of stack frames that were dropped because there were too many stack frames. If this value is 0, then no stack frames were dropped. | A description of a binary module. ```yaml "module": .opencensus.proto.trace.TruncatableString "buildId": .opencensus.proto.trace.TruncatableString ``` | Field | Type | Description | | -- | - | -- | | `module` | | TODO: document the meaning of this field. For example: main binary, kernel modules, and dynamic libraries such as libc.so, sharedlib.so. | | `buildId` | | A unique identifier for the module, usually a hash of its contents. | A string that might be shortened to a specified length. ```yaml "value": string "truncatedByteCount": int ``` | Field | Type | Description | | -- | - | -- | | `value` | `string` | The shortened string. For example, if the original string was 500 bytes long and the limit of the string was 128 bytes, then this value contains the first 128 bytes of the 500-byte string. Note that truncation always happens on a character boundary, to ensure that a truncated string is still valid UTF-8. Because it may contain multi-byte characters, the size of the truncated string may be less than the truncation limit. | | `truncatedByteCount` | `int` | The number of bytes removed from the original string. If this value is 0, then the string was not shortened. | <!-- Start of HubSpot Embed Code --> <script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/5130874.js"></script> <!-- End of HubSpot Embed Code -->