opentracing

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StartSpanOnTaskStart will start the span as soon as the task starts running.
	StartSpanOnTaskStart = StartSpan(iota)
	// StartSpanOnLastDepend will start the as soon as the task's last depend() call is done.
	// This mode is best used when all your tasks resolve all their dependencies as soon
	// as they're started.
	StartSpanOnLastDepend
)

Variables

View Source
var WithDisableTracing taskset.Property = func(task *taskset.Task) {
	task.ModifyProperty(disableTracingProperty{}, func(_ interface{}) interface{} {
		return struct{}{}
	})
}

WithDisableTracing disables tracing for a particular task.

Functions

func NewOpentracing

func NewOpentracing(startSpan StartSpan) taskset.Middleware

NewOpentracing creates a middleware that creates an opentracing span for each task.

Tracing can be disabled for a particular task using WithDisableTracing.

The operation name of the spans can be set using WithSpanOpName. If no name is set, it's formed as "taskset:" + properties.Name(task). If a task has no name, the operation name will be "taskset:task".

Start time of each span can be controlled using StartSpan.

func WithSpanOpName

func WithSpanOpName(name string) taskset.Property

WithSpanOpName sets the span operation name for a task.

Types

type StartSpan

type StartSpan int

StartSpan determines when to start the opentracing span.

Jump to

Keyboard shortcuts

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