startup_tracing

package module
v1.6.10 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UseGLS = true

Use the legacy GLS way to forward spans using goroutine-local storage.

Functions

func CurrentSpan deprecated added in v1.5.7

func CurrentSpan() opentracing.Span

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

Deprecated: Start using the version with an explicit context parameter.

func CurrentSpanFromContextOrGLS added in v1.6.2

func CurrentSpanFromContextOrGLS(ctx context.Context) opentracing.Span

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

func Execute added in v1.5.7

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

func NewPropagatingRoundTripper added in v1.5.7

func NewPropagatingRoundTripper(rt http.RoundTripper) http.RoundTripper

func TraceChild deprecated added in v1.5.7

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.

Deprecated: propagate spans using context.

func TraceChildContext added in v1.6.0

func TraceChildContext(ctx context.Context, op string, fn func(ctx context.Context, span opentracing.Span) error) (err error)

Trace a child call while propagating the span using the context.

func TraceOrCreate deprecated added in v1.5.7

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.

Deprecated: propagate spans using context.

func Tracing added in v1.5.7

func Tracing(service string, op string) startup_http.HttpMiddleware

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.

You can use the tracing middleware multiple time. Using it a second time will not start a new trace but will update 'service' and 'operation'.

func WithSpan deprecated added in v1.5.7

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

Deprecated: Please propagate spans using contexts.

func WithSpanPropagation added in v1.5.7

func WithSpanPropagation(client *http.Client) *http.Client

Returns a new http.Client that has automatic propagation of zipkin trace ids enabled.

Types

type TracingOptions

type TracingOptions struct {
	Zipkin string `long:"zipkin" validate:"omitempty,url" description:"Zipkin server base url, an URL like http://host:9411/"`

	Inputs struct {
		// The service name of your application
		ServiceName string `validate:"required"`
	}
	// contains filtered or unexported fields
}

func (*TracingOptions) Initialize

func (opts *TracingOptions) Initialize()

func (*TracingOptions) IsActive

func (opts *TracingOptions) IsActive() bool

Jump to

Keyboard shortcuts

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