tracer

package
v0.13.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, tracer TracerBackend) (func() error, error)

func InitOpenTelemetry added in v0.10.25

func InitOpenTelemetry(ctx context.Context, exporter sdktrace.SpanProcessor) (apitrace.Tracer, error)

func TagStrToMap

func TagStrToMap(tagStr string) map[string]string

TagStrToMap converts a user-passed string of tags of the form `key1=val1,key2=val2` to a map.

func TraceID

func TraceID(ctx context.Context) (string, error)

Types

type SpanCollector added in v0.10.25

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

SpanCollector does 3 things: 1) Accepts spans from OpenTelemetry. 2) Stores spans (for now, in memory) 3) Allows consumers to read spans they might want to send elsewhere Numbers 2 and 3 access the same data, and so it's a concurrency issue.

func NewSpanCollector added in v0.10.25

func NewSpanCollector(ctx context.Context) *SpanCollector

func (*SpanCollector) Close added in v0.10.25

func (c *SpanCollector) Close() error

func (*SpanCollector) GetOutgoingSpans added in v0.10.25

func (c *SpanCollector) GetOutgoingSpans() (io.Reader, func(), error)

SpanSource

func (*SpanCollector) OnEnd added in v0.10.25

func (c *SpanCollector) OnEnd(sd *exporttrace.SpanData)

func (*SpanCollector) OnStart added in v0.10.25

func (c *SpanCollector) OnStart(sd *exporttrace.SpanData)

OpenTelemetry exporter methods

func (*SpanCollector) Shutdown added in v0.10.25

func (c *SpanCollector) Shutdown()

type SpanSource added in v0.10.25

type SpanSource interface {
	// GetOutgoingSpans gives a consumer access to spans they should send
	// If there are no outoing spans, err will be io.EOF
	// rejectFn allows client to reject spans, so they can be requeued
	// rejectFn must be called, if at all, before the next call to GetOutgoingSpans
	GetOutgoingSpans() (data io.Reader, rejectFn func(), err error)

	// Close closes the SpanSource; the client may not interact with this SpanSource after calling Close
	Close() error
}

SpanSource is the interface for consumers (generally telemetry.Controller)

type TracerBackend added in v0.8.0

type TracerBackend int
const (
	Windmill TracerBackend = iota
	Lightstep
	Jaeger
)

func StringToTracerBackend added in v0.8.0

func StringToTracerBackend(s string) (TracerBackend, error)

Jump to

Keyboard shortcuts

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