Documentation
¶
Index ¶
- Constants
- Variables
- func BytesToInt64SpanID(b []byte) (int64, error)
- func BytesToInt64TraceID(traceID []byte) (int64, int64, error)
- func BytesToUInt64SpanID(b []byte) (uint64, error)
- func BytesToUInt64TraceID(traceID []byte) (uint64, uint64, error)
- func Int64ToByteSpanID(id int64) []byte
- func Int64ToByteTraceID(high, low int64) []byte
- func OCAttributeKeyExist(ocAttributes *tracepb.Span_Attributes, key string) bool
- func OCStatusCodeFromHTTP(code int32) int32
- func UInt64ToByteSpanID(id uint64) []byte
- func UInt64ToByteTraceID(high, low uint64) []byte
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" TagSpanKind = "span.kind" TagStatusCode = "status.code" TagStatusMsg = "status.message" 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") )
Functions ¶
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 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 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 OC status code
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.
Types ¶
This section is empty.