Documentation
¶
Index ¶
- Variables
- func CurrentSpan() opentracing.Spandeprecated
- func CurrentSpanFromContextOrGLS(ctx context.Context) opentracing.Span
- func Execute(op string, r *http.Request, client *http.Client) (*http.Response, error)
- func NewPropagatingRoundTripper(rt http.RoundTripper) http.RoundTripper
- func TraceChild(op string, fn func(span opentracing.Span) error, ...) (err error)deprecated
- func TraceChildContext(ctx context.Context, op string, ...) (err error)
- func TraceOrCreate(op string, fn func(span opentracing.Span) error, ...) (err error)deprecated
- func Tracing(service string, op string) startup_http.HttpMiddleware
- func WithSpan(span opentracing.Span, fn func())deprecated
- func WithSpanPropagation(client *http.Client) *http.Client
- type TracingOptions
Constants ¶
This section is empty.
Variables ¶
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 ¶
Returns the current span, or nil, if no span is currently set in local storage.
func NewPropagatingRoundTripper ¶
func NewPropagatingRoundTripper(rt http.RoundTripper) http.RoundTripper
func TraceChild
deprecated
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 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.
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