Help us shape the future of Go! Take the 2026 Go Developer Survey

otelutil

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JaegerData

type JaegerData struct {
	Data []jaeger.Trace `json:"data"`
}

type Span

type Span struct {
	// Name is the name of a specific span
	Name string
	// SpanContext is the unique SpanContext that identifies the span
	SpanContext trace.SpanContext
	// Parten is the unique SpanContext that identifies the parent of the span.
	// If the span has no parent, this span context will be invalid.
	Parent trace.SpanContext
	// SpanKind is the role the span plays in a Trace
	SpanKind trace.SpanKind
	// StartTime is the time the span started recording
	StartTime time.Time
	// EndTime returns the time the span stopped recording
	EndTime time.Time
	// Attributes are the defining attributes of a span
	Attributes []attribute.KeyValue
	// Events are all the events that occurred within the span
	Events []tracesdk.Event
	// Links are all the links the span has to other spans
	Links []tracesdk.Link
	// Status is that span status
	Status tracesdk.Status
	// DroppedAttributes is the number of attributes dropped by the span due to
	// a limit being reached
	DroppedAttributes int
	// DroppedEvents is the number of attributes dropped by the span due to a
	// limit being reached
	DroppedEvents int
	// DroppedLinks is the number of links dropped by the span due to a limit
	// being reached
	DroppedLinks int
	// ChildSpanCount is the count of spans that consider the span a direct
	// parent
	ChildSpanCount int
	// Resource is the information about the entity that produced the span
	// We have to change this type from the otel type to make this struct
	// marshallable
	Resource []attribute.KeyValue
	// InstrumentationLibrary is information about the library that produced
	// the span
	InstrumentationLibrary instrumentation.Scope
}

Span is a type similar to otel's SpanStub, but with the correct types needed for handle marshaling and unmarshalling.

func (*Span) Snapshot

func (s *Span) Snapshot() tracesdk.ReadOnlySpan

Snapshot turns a Span into a ReadOnlySpan which is exportable by otel.

func (*Span) UnmarshalJSON

func (s *Span) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for Span which allows correctly retrieving attribute.KeyValue values.

type Spans

type Spans []Span

func ParseSpanStubs

func ParseSpanStubs(rdr io.Reader) (Spans, error)

ParseSpanStubs parses BuildKit trace data into a list of SpanStubs.

func (Spans) JaegerData

func (s Spans) JaegerData() JaegerData

JaegerData return Jaeger data compatible with ui import feature. https://github.com/jaegertracing/jaeger-ui/issues/381#issuecomment-494150826

func (Spans) Len

func (s Spans) Len() int

Len return the length of the Spans.

func (Spans) ReadOnlySpans

func (s Spans) ReadOnlySpans() []tracesdk.ReadOnlySpan

ReadOnlySpans return a list of tracesdk.ReadOnlySpan from span stubs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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