sdk

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Span

type Span interface {
	// SetAttribute sets an attribute for the span.
	SetAttribute(key string, value interface{})

	// SetError sets an error for the span.
	SetError(err error)

	// IsNoop tells whether the span is noop or not, useful for avoiding
	// expensive recording.
	IsNoop() bool
}

Span is an interface that accept attributed and can be distinguished as noop

type SpanFromContext

type SpanFromContext func(ctx context.Context) Span

SpanFromContext retrieves the existing span from a context

type SpanKind

type SpanKind string

SpanKind represents the span kind, either Client, Server, Producer, Consumer or undertermine

const (
	Undetermined SpanKind = ""
	Client       SpanKind = "CLIENT"
	Server       SpanKind = "SERVER"
	Producer     SpanKind = "PRODUCER"
	Consumer     SpanKind = "CONSUMER"
)

type SpanOptions

type SpanOptions struct {
	Kind      SpanKind
	Timestamp time.Time
}

SpanOptions describes the options for starting a span

type StartSpan

type StartSpan func(ctx context.Context, name string, opts *SpanOptions) (context.Context, Span, func())

StartSpan creates a span and injects into a context, returning a span ender function

Directories

Path Synopsis
instrumentation
internal

Jump to

Keyboard shortcuts

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