Documentation ¶
Index ¶
- func CurrentSpanFromContext(ctx context.Context) opentracing.Span
- func NewPropagatingRoundTripper(rt http.RoundTripper) http.RoundTripper
- func TagsFromContext(ctx context.Context) opentracing.StartSpanOption
- func Trace(ctx context.Context, op string, ...) (err error)
- func TraceWithResult[T any](ctx context.Context, op string, ...) (result T, err error)
- func Tracing(service string, op string) startup_http.HttpMiddleware
- func WithServiceOverride(ctx context.Context, service string) context.Context
- func WithSpanPropagation(client *http.Client) *http.Client
- func WithTags(ctx context.Context, tags opentracing.Tags) context.Context
- type TracingOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentSpanFromContext ¶ added in v2.2.19
CurrentSpanFromContext returns the current span, or nil.
func NewPropagatingRoundTripper ¶
func NewPropagatingRoundTripper(rt http.RoundTripper) http.RoundTripper
func TagsFromContext ¶ added in v2.2.136
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
WithServiceOverride adds a `dd.service` tag to the context. See WithTags
func WithSpanPropagation ¶
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)
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