otelstorage

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package otelstorage contains common types and utilities for storing OpenTelemetry data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyToLabel added in v0.1.0

func KeyToLabel(key string) string

KeyToLabel converts key to label name.

Types

type Attrs

type Attrs pcommon.Map

Attrs wraps attributes.

func (Attrs) AsMap

func (m Attrs) AsMap() pcommon.Map

AsMap returns Attrs as pcommon.Map.

func (Attrs) CopyTo

func (m Attrs) CopyTo(target pcommon.Map)

CopyTo copies all attributes from m to target.

func (Attrs) Hash added in v0.7.0

func (m Attrs) Hash() Hash

Hash computes attributes Hash.

func (Attrs) IsZero added in v0.0.8

func (m Attrs) IsZero() bool

IsZero whether Attrs is zero value.

type Hash added in v0.1.0

type Hash [16]byte

Hash is an attribute hash.

func AttrHash added in v0.1.0

func AttrHash(m pcommon.Map) Hash

AttrHash computes attributes hash.

func (Hash) String added in v0.7.0

func (h Hash) String() string

type SpanID

type SpanID [8]byte

SpanID is OpenTelemetry span ID.

func SpanIDFromUint64

func SpanIDFromUint64(v uint64) (r SpanID)

SpanIDFromUint64 creates new SpanID from uint64.

func (SpanID) AsUint64

func (id SpanID) AsUint64() uint64

AsUint64 returns span ID as LittleEndian uint64.

func (SpanID) Hex

func (id SpanID) Hex() string

Hex returns a hex representation of SpanID.

func (SpanID) IsEmpty

func (id SpanID) IsEmpty() bool

IsEmpty returns true if span ID is empty.

type Timestamp

type Timestamp = pcommon.Timestamp

Timestamp is a time specified as UNIX Epoch time in nanoseconds since 1970-01-01 00:00:00 +0000 UTC.

func NewTimestampFromTime

func NewTimestampFromTime(t time.Time) Timestamp

NewTimestampFromTime creates new Timestamp from time.Time.

type TraceID

type TraceID [16]byte

TraceID is OpenTelemetry trace ID.

func ParseTraceID

func ParseTraceID(input string) (_ TraceID, err error)

ParseTraceID parses trace ID from given string.

Deals with missing leading zeroes.

func (TraceID) Hex

func (id TraceID) Hex() string

Hex returns a hex representation of TraceID.

func (TraceID) IsEmpty

func (id TraceID) IsEmpty() bool

IsEmpty returns true if span ID is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL