otelutil

package module
v0.0.0-...-7585d43 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: BSD-2-Clause Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attribute

func Attribute(key string, value interface{}) attribute.KeyValue

Types

type Event

type Event struct {
	// Name is the name of this event
	Name string

	// Attributes describe the aspects of the event.
	Attributes []attribute.KeyValue

	// DroppedAttributeCount is the number of attributes that were not
	// recorded due to configured limits being reached.
	DroppedAttributeCount int

	// Time at which this event was recorded.
	Time time.Time
}

Event is a thing that happened during a Span's lifetime. Taken from https://github.com/open-telemetry/opentelemetry-go/blob/sdk/v1.16.0/sdk/trace/event.go.

type SpanRecorder

type SpanRecorder struct {
	// contains filtered or unexported fields
}

SpanRecorder records started and ended spans.

func NewSpanRecorder

func NewSpanRecorder() *SpanRecorder

NewSpanRecorder returns a new initialized SpanRecorder.

func (*SpanRecorder) Ended

func (sr *SpanRecorder) Ended() []sdktrace.ReadOnlySpan

Ended returns a copy of all ended spans that have been recorded.

This method is safe to be called concurrently.

func (*SpanRecorder) ForceFlush

func (sr *SpanRecorder) ForceFlush(context.Context) error

ForceFlush does nothing.

This method is safe to be called concurrently.

func (*SpanRecorder) OnEnd

func (sr *SpanRecorder) OnEnd(s sdktrace.ReadOnlySpan)

OnEnd records completed spans.

This method is safe to be called concurrently.

func (*SpanRecorder) OnStart

OnStart records started spans.

This method is safe to be called concurrently.

func (*SpanRecorder) Shutdown

func (sr *SpanRecorder) Shutdown(context.Context) error

Shutdown does nothing.

This method is safe to be called concurrently.

func (*SpanRecorder) Started

func (sr *SpanRecorder) Started() []sdktrace.ReadWriteSpan

Started returns a copy of all started spans that have been recorded.

This method is safe to be called concurrently.

Jump to

Keyboard shortcuts

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