Documentation
¶
Overview ¶
Package tracing holds the opentracing span helpers used by the SDK.
They were previously imported from go-restful-plugins/v3/pkg/jaeger, which also pulled in its Jaeger client and HTTP framework dependencies. The behaviour is unchanged: spans are created through opentracing's global tracer, so they are recorded only if the application registers one.
Index ¶
- func AddLog(span opentracing.Span, key string, value string)
- func AddTag(span opentracing.Span, key string, value string)
- func Finish(span opentracing.Span)
- func InjectSpanIntoRequest(span opentracing.Span, req *http.Request) error
- func StartChildSpan(span opentracing.Span, name string) opentracing.Span
- func StartSpanFromContext(ctx context.Context, operationName string) (opentracing.Span, context.Context)
- func TraceError(span opentracing.Span, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLog ¶
func AddLog(span opentracing.Span, key string, value string)
AddLog adds a key/value log field to span if it is not nil.
func AddTag ¶
func AddTag(span opentracing.Span, key string, value string)
AddTag sets a tag on span if it is not nil.
func InjectSpanIntoRequest ¶
func InjectSpanIntoRequest(span opentracing.Span, req *http.Request) error
InjectSpanIntoRequest writes the span context into the request headers.
func StartChildSpan ¶
func StartChildSpan(span opentracing.Span, name string) opentracing.Span
StartChildSpan starts a span as a child of span. It returns nil when span is nil.
func StartSpanFromContext ¶
func StartSpanFromContext(ctx context.Context, operationName string) (opentracing.Span, context.Context)
StartSpanFromContext starts a span as a child of the span in ctx. It returns a nil span when ctx is nil.
func TraceError ¶
func TraceError(span opentracing.Span, err error)
TraceError records err on span as an error log field and sets the standard boolean error tag.
Types ¶
This section is empty.