span

package
v0.0.0-...-fe23bbf Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: AGPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenTelemetrySpan

type OpenTelemetrySpan struct {
	trace.Span
}

func (*OpenTelemetrySpan) End

func (s *OpenTelemetrySpan) End()

func (*OpenTelemetrySpan) SetAttributes

func (s *OpenTelemetrySpan) SetAttributes(attributes []observability.KeyValue) error

func (*OpenTelemetrySpan) SpanID

func (s *OpenTelemetrySpan) SpanID() string

func (*OpenTelemetrySpan) TraceID

func (s *OpenTelemetrySpan) TraceID() string

func (*OpenTelemetrySpan) WithTraceID

func (s *OpenTelemetrySpan) WithTraceID(traceID string) error

type Span

type Span interface {
	// SpanID returns the SpanID.
	SpanID() string
	// TradeID returns the TradeID.
	TraceID() string
	// End completes the Span. The Span is considered complete and ready to be
	// delivered through the rest of the telemetry pipeline after this method
	// is called. Therefore, updates to the Span are not allowed after this
	// method has been called.
	End()
	// SetAttributes sets kv as attributes of the Span. If a key from kv
	// already exists for an attribute of the Span it will be overwritten with
	// the value contained in kv.
	SetAttributes(attributes []observability.KeyValue) error

	WithTraceID(traceID string) error
}

type SpanConfig

type SpanConfig struct {
	SpanKind SpanKind
}

func (*SpanConfig) GetSpanKind

func (tc *SpanConfig) GetSpanKind() SpanKind

func (*SpanConfig) SetSpanKind

func (tc *SpanConfig) SetSpanKind(spanKind SpanKind)

type SpanKind

type SpanKind int
const (
	// SpanKindUnspecified is an unspecified SpanKind and is not a valid
	// SpanKind. SpanKindUnspecified should be replaced with SpanKindInternal
	// if it is received.
	SpanKindUnspecified SpanKind = 0
	// SpanKindInternal is a SpanKind for a Span that represents an internal
	// operation within an application.
	SpanKindInternal SpanKind = 1
	// SpanKindServer is a SpanKind for a Span that represents the operation
	// of handling a request from a client.
	SpanKindServer SpanKind = 2
	// SpanKindClient is a SpanKind for a Span that represents the operation
	// of client making a request to a server.
	SpanKindClient SpanKind = 3
	// SpanKindProducer is a SpanKind for a Span that represents the operation
	// of a producer sending a message to a message broker. Unlike
	// SpanKindClient and SpanKindServer, there is often no direct
	// relationship between this kind of Span and a SpanKindConsumer kind. A
	// SpanKindProducer Span will end once the message is accepted by the
	// message broker which might not overlap with the processing of that
	// message.
	SpanKindProducer SpanKind = 4
	// SpanKindConsumer is a SpanKind for a Span that represents the operation
	// of a consumer receiving a message from a message broker. Like
	// SpanKindProducer Spans, there is often no direct relationship between
	// this Span and the Span that produced the message.
	SpanKindConsumer SpanKind = 5
)

As a convenience, these match the proto definition, see to coerce a span kind to a valid value.

type SpanOption

type SpanOption interface {
	GetSpanKind() SpanKind
	SetSpanKind(spanKind SpanKind)
}

Jump to

Keyboard shortcuts

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