tracing

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Span

type Span interface {
	// Sets the end timestamp and finalizes Span state.
	Finish()

	// Adds key/value pairs to the span.
	LogKV(alternatingKeyValues ...interface{})
}

Span represents a single span in a distributed trace.

func StartSpanFromContext

func StartSpanFromContext(ctx context.Context, operationName string) (Span, context.Context)

StartSpanFromContext returnus a new child span and context from a given context using the global tracer.

type Tracer

type Tracer interface {
	// Returns a new child span and context from a given context.
	StartSpanFromContext(ctx context.Context, operationName string) (Span, context.Context)

	// Adds the required HTTP headers to pass context between nodes.
	InjectHTTPHeaders(r *http.Request)

	// Reads the HTTP headers to derive incoming context.
	ExtractHTTPHeaders(r *http.Request) (Span, context.Context)
}

Tracer implements a generic distributed tracing interface.

var GlobalTracer Tracer = NopTracer()

GlobalTracer is a single, global instance of Tracer.

func NopTracer

func NopTracer() Tracer

NopTracer returns a tracer that doesn't do anything.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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