Back to godoc.org
go.opentelemetry.io/collector/translator/trace

package tracetranslator

v0.4.0
Latest Go to latest
Published: Jun 16, 2020 | License: Apache-2.0 | Module: go.opentelemetry.io/collector

Index

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
	OCUnavailable        = 14
	OCDataLoss           = 15
	OCUnauthenticated    = 16
)

https://github.com/googleapis/googleapis/blob/bee79fbe03254a35db125dc6d2f1e9b752b390fe/google/rpc/code.proto#L33-L186

const (
	AnnotationDescriptionKey = "description"

	MessageEventIDKey               = "message.id"
	MessageEventTypeKey             = "message.type"
	MessageEventCompressedSizeKey   = "message.compressed_size"
	MessageEventUncompressedSizeKey = "message.uncompressed_size"

	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"
)

Some of the keys used to represent OC proto constructs as tags or annotations in other formats.

Variables

var (
	// ErrNilTraceID error returned when the TraceID is nil
	ErrNilTraceID = errors.New("TraceID is nil")
	// ErrWrongLenTraceID error returned when the TraceID does not have 16 bytes.
	ErrWrongLenTraceID = errors.New("TraceID does not have 16 bytes")
	// ErrNilSpanID error returned when the SpanID is nil
	ErrNilSpanID = errors.New("SpanID is nil")
	// ErrWrongLenSpanID error returned when the SpanID does not have 8 bytes.
	ErrWrongLenSpanID = errors.New("SpanID does not have 8 bytes")
)

func BytesToInt64SpanID

func BytesToInt64SpanID(b []byte) (int64, error)

BytesToInt64SpanID takes a []byte representation of a SpanID and converts it to a int64 representation.

func BytesToInt64TraceID

func BytesToInt64TraceID(traceID []byte) (int64, int64, error)

BytesToInt64TraceID takes a []byte representation of a TraceID and converts it to a two int64 representation.

func BytesToUInt64SpanID

func BytesToUInt64SpanID(b []byte) (uint64, error)

BytesToUInt64SpanID takes a []byte representation of a SpanID and converts it to a uint64 representation.

func BytesToUInt64TraceID

func BytesToUInt64TraceID(traceID []byte) (uint64, uint64, error)

BytesToUInt64TraceID takes a []byte representation of a TraceID and converts it to a two uint64 representation.

func HTTPStatusCodeFromOCStatus

func HTTPStatusCodeFromOCStatus(code int32) int32

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

func Int64ToByteSpanID(id int64) []byte

Int64ToByteSpanID takes a int64 representation of a SpanID and converts it to a []byte representation.

func Int64ToByteTraceID

func Int64ToByteTraceID(high, low int64) []byte

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

func OCStatusCodeFromHTTP(code int32) int32

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 UInt64ToByteSpanID

func UInt64ToByteSpanID(id uint64) []byte

UInt64ToByteSpanID takes a uint64 representation of a SpanID and converts it to a []byte representation.

func UInt64ToByteTraceID

func UInt64ToByteTraceID(high, low uint64) []byte

UInt64ToByteTraceID takes a two uint64 representation of a TraceID and converts it to a []byte representation.

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 also used for representing internally span kinds that have no equivalents in OpenCensus format. They are stored as values of TagSpanKind Note: this internal usage needs to be eliminated when we move to OTLP for internal in-memory representation since OTLP has the equivalents.

const (
	OpenTracingSpanKindUnspecified OpenTracingSpanKind = ""
	OpenTracingSpanKindClient      OpenTracingSpanKind = "client"
	OpenTracingSpanKindServer      OpenTracingSpanKind = "server"
	OpenTracingSpanKindConsumer    OpenTracingSpanKind = "consumer"
	OpenTracingSpanKindProducer    OpenTracingSpanKind = "producer"
)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier