This section is empty.


This section is empty.


func Init

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

func InitOpenTelemetry

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)


type SpanCollector

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

func NewSpanCollector(ctx context.Context) *SpanCollector

func (*SpanCollector) Close

func (c *SpanCollector) Close() error

func (*SpanCollector) GetOutgoingSpans

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


func (*SpanCollector) OnEnd

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

func (*SpanCollector) OnStart

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

OpenTelemetry exporter methods

func (*SpanCollector) Shutdown

func (c *SpanCollector) Shutdown()

type SpanSource

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

type TracerBackend int
const (
	Windmill TracerBackend = iota

func StringToTracerBackend

func StringToTracerBackend(s string) (TracerBackend, error)