Documentation ¶
Index ¶
- Constants
- func AttributeArrayToSlice(attrArray pdata.AnyValueArray) []interface{}
- func AttributeMapToMap(attrMap pdata.AttributeMap) map[string]interface{}
- func AttributeValueToString(attr pdata.AttributeValue, jsonLike bool) string
- func BytesToInt64SpanID(b [8]byte) int64
- func BytesToInt64TraceID(traceID [16]byte) (int64, int64)
- func BytesToUInt64SpanID(b [8]byte) uint64
- func BytesToUInt64TraceID(traceID [16]byte) (uint64, uint64)
- func DetermineValueType(value string, omitSimpleTypes bool) pdata.AttributeValueType
- func HTTPStatusCodeFromOCStatus(code int32) int32
- func Int64ToByteSpanID(id int64) [8]byte
- func Int64ToByteTraceID(high, low int64) [16]byte
- func Int64ToSpanID(id int64) pdata.SpanID
- func Int64ToTraceID(high, low int64) pdata.TraceID
- func OCAttributeKeyExist(ocAttributes *tracepb.Span_Attributes, key string) bool
- func OCStatusCodeFromHTTP(code int32) int32
- func StatusCodeFromHTTP(httpStatusCode int) pdata.StatusCode
- func TraceIDToUInt64Pair(traceID pdata.TraceID) (uint64, uint64)
- func UInt64ToByteSpanID(id uint64) [8]byte
- func UInt64ToByteTraceID(high, low uint64) [16]byte
- func UInt64ToSpanID(id uint64) pdata.SpanID
- func UInt64ToTraceID(high, low uint64) pdata.TraceID
- func UpsertStringToAttributeMap(key string, val string, dest pdata.AttributeMap, omitSimpleTypes bool)
- type OpenTracingSpanKind
Constants ¶
const ( OCOK = 0 OCCancelled = 1 OCUnknown = 2 OCInvalidArgument = 3 OCDeadlineExceeded = 4 OCNotFound = 5 OCAlreadyExists = 6 OCPermissionDenied = 7 OCResourceExhausted = 8 OCFailedPrecondition = 9 OCAborted = 10 OCOutOfRange = 11 OCUnimplemented = 12 OCInternal = 13 OCDataLoss = 15 OCUnauthenticated = 16 )
const ( AnnotationDescriptionKey = "description" MessageEventIDKey = "message.id" MessageEventTypeKey = "message.type" MessageEventCompressedSizeKey = "message.compressed_size" MessageEventUncompressedSizeKey = "message.uncompressed_size" TagMessage = "message" TagSpanKind = "span.kind" TagStatusCode = "status.code" TagStatusMsg = "status.message" TagError = "error" TagHTTPStatusCode = "http.status_code" TagHTTPStatusMsg = "http.status_message" TagZipkinCensusCode = "census.status_code" TagZipkinCensusMsg = "census.status_description" TagZipkinOpenCensusMsg = "opencensus.status_description" TagW3CTraceState = "w3c.tracestate" TagServiceNameSource = "otlp.service.name.source" TagInstrumentationName = "otlp.instrumentation.library.name" TagInstrumentationVersion = "otlp.instrumentation.library.version" )
Some of the keys used to represent OTLP constructs as tags or annotations in other formats.
const ( SpanLinkDataFormat = "%s|%s|%s|%s|%d" SpanEventDataFormat = "%s|%s|%d" )
const (
ResourceNoServiceName = "OTLPResourceNoServiceName"
)
Constants used for signifying batch-level attribute values where not supplied by OTLP data but required by other protocols.
Variables ¶
This section is empty.
Functions ¶
func AttributeArrayToSlice ¶
func AttributeArrayToSlice(attrArray pdata.AnyValueArray) []interface{}
func AttributeMapToMap ¶
func AttributeMapToMap(attrMap pdata.AttributeMap) map[string]interface{}
AttributeMapToMap converts an OTLP AttributeMap to a standard go map
func AttributeValueToString ¶
func AttributeValueToString(attr pdata.AttributeValue, jsonLike bool) string
AttributeValueToString converts an OTLP AttributeValue object to its equivalent string representation
func BytesToInt64SpanID ¶
BytesToInt64SpanID takes a []byte representation of a SpanID and converts it to a int64 representation.
func BytesToInt64TraceID ¶
BytesToInt64TraceID takes a []byte representation of a TraceID and converts it to a two int64 representation.
func BytesToUInt64SpanID ¶
BytesToUInt64SpanID takes a []byte representation of a SpanID and converts it to a uint64 representation.
func BytesToUInt64TraceID ¶
BytesToUInt64TraceID takes a []byte representation of a TraceID and converts it to a two uint64 representation.
func DetermineValueType ¶
func DetermineValueType(value string, omitSimpleTypes bool) pdata.AttributeValueType
DetermineValueType returns the native OTLP attribute type the string translates to.
func HTTPStatusCodeFromOCStatus ¶
HTTPStatusCodeFromOCStatus takes an OpenTelemetry status code and return the appropriate HTTP status code See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-http.md
func Int64ToByteSpanID ¶
Int64ToByteSpanID takes a int64 representation of a SpanID and converts it to a []byte representation.
func Int64ToByteTraceID ¶
Int64ToByteTraceID takes a two int64 representation of a TraceID and converts it to a []byte representation.
func Int64ToSpanID ¶
Int64ToByteSpanID takes a int64 representation of a SpanID and converts it to a []byte representation.
func Int64ToTraceID ¶
Int64ToByteTraceID takes a two int64 representation of a TraceID and converts it to a []byte representation.
func OCAttributeKeyExist ¶
func OCAttributeKeyExist(ocAttributes *tracepb.Span_Attributes, key string) bool
OCAttributeKeyExist returns true if a key in attribute of an OC Span exists. It returns false, if attributes is nil, the map itself is nil or the key wasn't found.
func OCStatusCodeFromHTTP ¶
OCStatusCodeFromHTTP takes an HTTP status code and return the appropriate OpenTelemetry status code See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-http.md
func StatusCodeFromHTTP ¶
func StatusCodeFromHTTP(httpStatusCode int) pdata.StatusCode
StatusCodeFromHTTP takes an HTTP status code and return the appropriate OpenTelemetry status code See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md#status
func TraceIDToUInt64Pair ¶
TraceIDToUInt64Pair takes a pdata.TraceID and converts it to a pair of uint64 representation.
func UInt64ToByteSpanID ¶
UInt64ToByteSpanID takes a uint64 representation of a SpanID and converts it to a []byte representation.
func UInt64ToByteTraceID ¶
UInt64ToByteTraceID takes a two uint64 representation of a TraceID and converts it to a []byte representation.
func UInt64ToSpanID ¶
UInt64ToSpanID takes a uint64 representation of a SpanID and converts it to a pdata.SpanID representation.
func UInt64ToTraceID ¶
UInt64ToByteTraceID takes a two uint64 representation of a TraceID and converts it to a []byte representation.
func UpsertStringToAttributeMap ¶
func UpsertStringToAttributeMap(key string, val string, dest pdata.AttributeMap, omitSimpleTypes bool)
UpsertStringToAttributeMap upserts a string value to the specified key as it's native OTLP type
Types ¶
type OpenTracingSpanKind ¶
type OpenTracingSpanKind string
OpenTracingSpanKind are possible values for TagSpanKind and match the OpenTracing conventions: https://github.com/opentracing/specification/blob/master/semantic_conventions.md These values are used for representing span kinds that have no equivalents in OpenCensus format. They are stored as values of TagSpanKind
const ( OpenTracingSpanKindUnspecified OpenTracingSpanKind = "" OpenTracingSpanKindClient OpenTracingSpanKind = "client" OpenTracingSpanKindServer OpenTracingSpanKind = "server" OpenTracingSpanKindConsumer OpenTracingSpanKind = "consumer" OpenTracingSpanKindProducer OpenTracingSpanKind = "producer" OpenTracingSpanKindInternal OpenTracingSpanKind = "internal" )