startup_tracing

package
v2.3.32 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 27 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

CurrentSpanFromContext returns the current span, or nil.

func NewPropagatingRoundTripper

func NewPropagatingRoundTripper(rt http.RoundTripper) http.RoundTripper

func TagsFromContext added in v2.2.136

func TagsFromContext(ctx context.Context) opentracing.StartSpanOption

func Trace added in v2.2.99

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

func TraceWithResult added in v2.2.113

func TraceWithResult[T any](ctx context.Context, op string, fn func(ctx context.Context, span opentracing.Span) (T, error)) (result T, err error)

TraceWithResult traces a child call while propagating the span using the context. No need to call opentracing.ContextWithSpan yourself.

func Tracing

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

Tracing 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 WithServiceOverride added in v2.2.136

func WithServiceOverride(ctx context.Context, service string) context.Context

WithServiceOverride adds a `dd.service` tag to the context. See WithTags

func WithSpanPropagation

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

WithSpanPropagation returns a new http.Client that has automatic propagation of zipkin trace ids enabled, as well as automatic tracing of http client operations (dns, connect, tls-handshake)

func WithTags added in v2.2.136

func WithTags(ctx context.Context, tags opentracing.Tags) context.Context

WithTags adds the given Tags to the context. All spans that are created using functions from this package will automatically set those tags.

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