startup_tracing

package
v2.2.10 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: MIT Imports: 17 Imported by: 0

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

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

func CurrentSpanFromContextOrGLS(ctx context.Context) 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 NewPropagatingRoundTripper

func NewPropagatingRoundTripper(rt http.RoundTripper) http.RoundTripper

func TraceChild deprecated

func TraceChild(op string, fn func(span opentracing.Span) error, spanOpts ...opentracing.StartSpanOption) (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

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

func TraceOrCreate(op string, fn func(span opentracing.Span) error, spanOpts ...opentracing.StartSpanOption) (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

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

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

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