tracing

package
v1.8.22-0...-5b0d3fa Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TracingEnabledFlag is the CLI flag name to use to enable trace collections.
	TracingEnabledFlag = "tracing"

	// StoreLabelId is the context value key of the name of the span to be saved
	StoreLabelId = "span_save_id"

	// StoreLabelMeta is the context value key that together with StoreLabelId constitutes the retrieval key for saved spans in the span store
	// StartSaveSpan and ShiftSpanByKey
	StoreLabelMeta = "span_save_meta"
)

Variables

View Source
var (
	TracingFlag = cli.BoolFlag{
		Name:  TracingEnabledFlag,
		Usage: "Enable tracing",
	}
	TracingEndpointFlag = cli.StringFlag{
		Name:  "tracing.endpoint",
		Usage: "Tracing endpoint",
		Value: "0.0.0.0:6831",
	}
	TracingSvcFlag = cli.StringFlag{
		Name:  "tracing.svc",
		Usage: "Tracing service name",
		Value: "swarm",
	}
)
View Source
var (
	Closer io.Closer
)
View Source
var (
	// Enabled turns tracing on for the current swarm instance
	Enabled bool = false
)

Flags holds all command-line flags required for tracing collection.

Functions

func FinishSpans

func FinishSpans()

FinishSpans calls `Finish()` on all stored spans It should be called on instance shutdown

func Setup

func Setup(ctx *cli.Context)

func ShiftSpanByKey

func ShiftSpanByKey(k string) opentracing.Span

ShiftSpanByKey retrieves the span stored under the key of the string given as argument The span is then deleted from the store

func StartSaveSpan

func StartSaveSpan(ctx context.Context) context.Context

StartSaveSpan stores the span specified in the passed context for later retrieval The span object but be context value on the key StoreLabelId. It will be stored under the the following string key context.Value(StoreLabelId)|.|context.Value(StoreLabelMeta)

Types

This section is empty.

Jump to

Keyboard shortcuts

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