startup_tracing

package
v2.2.92 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentSpanFromContext added in v2.2.19

func CurrentSpanFromContext(ctx context.Context) opentracing.Span

Returns the current span, or nil.

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 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 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 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