Documentation ¶
Overview ¶
Package tracing contains orchestration code for opentracing. Specifically, it is used to build an integration with Jaeger.
Index ¶
- Variables
- func AddError(span opentracing.Span, err error)
- func New() (io.Closer, error)
- func SetSpanTag(ctx context.Context, key string, val interface{})
- func SpanFromMetadata(ctx context.Context, operationName string, md map[string]string) (opentracing.Span, context.Context, error)
- func SpanMetadata(span opentracing.Span) (map[string]string, error)
- func WithError(span opentracing.Span, err error) error
- func WrapHTTPHandler(h http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
var Flags = flag.Flags{ &flag.Boolean{ Name: "tracer-disabled", Usage: "If true, disables opentracing", EnvVar: "TRACER_DISABLED", Destination: &config.disabled, Hidden: true, }, &flag.String{ Name: "tracer-host", Usage: "Host for opentracing", EnvVar: "TRACER_HOST", Destination: &config.host, Hidden: true, }, &flag.Float64{ Name: "tracer-sample-rate", Usage: "Sample rate for traces", EnvVar: "TRACER_SAMPLE_RATE", Value: 1, Destination: &config.sampleRate, Hidden: true, }, &flag.Duration{ Name: "tracer-flush-interval", Usage: "Buffer flushing interval for traces", EnvVar: "TRACER_BUFFER_FLUSH_INTERVAL", Value: time.Second, Destination: &config.bufferFlushInterval, Hidden: true, }, }
Flags contains all command-line flags that can be used to configure tracing.
Functions ¶
func AddError ¶
func AddError(span opentracing.Span, err error)
AddError adds the provided error to the span.
func SetSpanTag ¶ added in v1.5.0
SetSpanTag adds the given key/value pair to the tags for the current span.
func SpanFromMetadata ¶ added in v1.5.0
func SpanFromMetadata(ctx context.Context, operationName string, md map[string]string) (opentracing.Span, context.Context, error)
SpanFromMetadata starts a new span whose name is set to operationName. The previous span is extracted from the given map[string]string. If no span metadata is set, a new span is started using whatever is inside the given context.
func SpanMetadata ¶ added in v1.5.0
SpanMetadata returns a map[string]string containing the metadata for the provided span. This should be used for passing span information across application boundaries.
Types ¶
This section is empty.