tracing

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentSpan

func CurrentSpan() opentracing.Span

Returns the current span, or nil, if no span is currently set in local storage.

func Execute

func Execute(op string, r *http.Request, client *http.Client) (*http.Response, error)

func TraceChild

func TraceChild(op string, fn func(span opentracing.Span) error) (err error)

Runs an operation and traces it with the given name. This will create a new child span if some span is currently active.

func TraceOrCreate

func TraceOrCreate(op string, fn func(span opentracing.Span) error) (err error)

Runs an operation and traces it with the given name. This will create a new span if no span is currently active.

func WithSpan

func WithSpan(span opentracing.Span, fn func())

Runs the given function with the provided span set in local storage for the duration of function call. This method will not call 'Finish()' on the span

Types

type Middleware

type Middleware func(http.Handler) http.Handler

func Tracing

func Tracing(service string, op string) Middleware

Returns a middleware that adds tracing to an http handler. This will create a new and empty local storage for the current go routine to propagate the tracing context.

Jump to

Keyboard shortcuts

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