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 DetermineValueType(value string, omitSimpleTypes bool) pdata.AttributeValueType
- func OCStatusCodeFromHTTP(code int32) int32
- func SpanIDToUInt64(spanID pdata.SpanID) uint64
- func StatusCodeFromHTTP(httpStatusCode int) pdata.StatusCode
- func TraceIDToUInt64Pair(traceID pdata.TraceID) (uint64, uint64)
- 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 ( 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" )
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 ¶ added in v0.11.0
func AttributeArrayToSlice(attrArray pdata.AnyValueArray) []interface{}
AttributeArrayToSlice creates a slice out of a pdata.AnyValueArray.
func AttributeMapToMap ¶ added in v0.11.0
func AttributeMapToMap(attrMap pdata.AttributeMap) map[string]interface{}
AttributeMapToMap converts an OTLP AttributeMap to a standard go map
func AttributeValueToString ¶ added in v0.8.0
func AttributeValueToString(attr pdata.AttributeValue, jsonLike bool) string
AttributeValueToString converts an OTLP AttributeValue object to its equivalent string representation
func DetermineValueType ¶ added in v0.11.0
func DetermineValueType(value string, omitSimpleTypes bool) pdata.AttributeValueType
DetermineValueType returns the native OTLP attribute type the string translates to.
func OCStatusCodeFromHTTP ¶
OCStatusCodeFromHTTP takes an HTTP status code and return the appropriate OpenTelemetry status code See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/data-http.md
func SpanIDToUInt64 ¶ added in v0.21.0
SpanIDToUInt64 converts the pdata.SpanID to uint64 representation.
func StatusCodeFromHTTP ¶ added in v0.14.0
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/main/specification/trace/semantic_conventions/http.md#status
func TraceIDToUInt64Pair ¶ added in v0.12.0
TraceIDToUInt64Pair converts the pdata.TraceID to a pair of uint64 representation.
func UInt64ToSpanID ¶ added in v0.12.0
UInt64ToSpanID converts the uint64 representation of a SpanID to pdata.SpanID.
func UInt64ToTraceID ¶ added in v0.12.0
UInt64ToTraceID converts the pair of uint64 representation of a TraceID to pdata.TraceID.
func UpsertStringToAttributeMap ¶ added in v0.11.0
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/main/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" )