tracing

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package tracing contains orchestration code for opentracing. Specifically, it is used to build an integration with Jaeger.

Index

Constants

This section is empty.

Variables

View Source
var Flags = flag.Flags{
	&flag.Boolean{
		Name:        "tracer-disabled",
		Usage:       "If true, disables opentracing",
		EnvVar:      "TRACER_DISABLED",
		Destination: &config.disabled,
	},
	&flag.String{
		Name:        "tracer-host",
		Usage:       "Host for opentracing",
		EnvVar:      "TRACER_HOST",
		Value:       "jaeger:6831",
		Destination: &config.host,
	},
	&flag.Float64{
		Name:        "tracer-sample-rate",
		Usage:       "Sample rate for traces",
		EnvVar:      "TRACER_SAMPLE_RATE",
		Value:       1,
		Destination: &config.sampleRate,
	},
	&flag.Duration{
		Name:        "tracer-flush-interval",
		Usage:       "Buffer flushing interval for traces",
		EnvVar:      "TRACER_BUFFER_FLUSH_INTERVAL",
		Value:       time.Second,
		Destination: &config.bufferFlushInterval,
	},
}

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 New

func New() (io.Closer, error)

New sets up the global tracer. The io.Closer instance returned is used to stop tracing.

func WithError

func WithError(span opentracing.Span, err error) error

WithError returns err after adding its details to the span.

func WrapHTTPHandler

func WrapHTTPHandler(h http.Handler) http.Handler

WrapHTTPHandler wraps an http.Handler so that all inbound requests create a trace. Ignores operational endpoints.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL