Back to godoc.org
github.com/pilosa/pilosa / tracing

package tracing

v1.4.0
Latest Go to latest
Published: Sep 17, 2019 | License: Apache-2.0 | Module: github.com/pilosa/pilosa

Index

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.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier