tracing

package module
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 16 Imported by: 3

README

tracing

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfiguration

func DefaultConfiguration(service, addr string) *config.Configuration

func EnablePrometheusMetrics added in v0.13.0

func EnablePrometheusMetrics() error

func InitWarnLogger

func InitWarnLogger(logger WarnLogger)

func InjectBinary

func InjectBinary(ctx context.Context, carrier io.Writer) error

func InjectHeaders

func InjectHeaders(ctx context.Context, carrier http.Header) error

func InjectMap

func InjectMap(ctx context.Context, carrier map[string]string) error

func LogKV

func LogKV(ctx context.Context, key string, value interface{})

LogKV is a concise, readable way to record key:value logging data about a Span, though unfortunately this also makes it less efficient and less type-safe than LogFields(). Here's an example:

span.LogKV(
    "event", "soft error",
    "type", "cache timeout",
    "waited.millis", 1500)

For LogKV (as opposed to LogFields()), the parameters must appear as key-value pairs, like

span.LogKV(key1, val1, key2, val2, key3, val3, ...)

The keys must all be strings. The values may be strings, numeric types, bools, Go error instances, or arbitrary structs.

(Note to implementors: consider the log.InterleavedKVToFields() helper).

func SpanFromContext

func SpanFromContext(ctx context.Context) opentracing.Span

Types

type Span

type Span struct {
	// contains filtered or unexported fields
}

func ChildSpan

func ChildSpan(ctx *context.Context) (s *Span)

func FollowsSpan

func FollowsSpan(ctx *context.Context) (s *Span)

func (*Span) BaggageItem

func (s *Span) BaggageItem(restrictedKey string) string

func (*Span) Context

func (s *Span) Context() opentracing.SpanContext

func (*Span) Finish

func (s *Span) Finish()

func (*Span) FinishWithOptions

func (s *Span) FinishWithOptions(opts opentracing.FinishOptions)

func (*Span) Log deprecated

func (s *Span) Log(data opentracing.LogData)

Deprecated: use LogFields or LogKV.

func (*Span) LogEvent deprecated

func (s *Span) LogEvent(event string)

Deprecated: use LogFields or LogKV.

func (*Span) LogEventWithPayload deprecated

func (s *Span) LogEventWithPayload(event string, payload interface{})

Deprecated: use LogFields or LogKV.

func (*Span) LogFields

func (s *Span) LogFields(fields ...log.Field)

func (*Span) LogKV

func (s *Span) LogKV(alternatingKeyValues ...interface{})

func (*Span) SetBaggageItem

func (s *Span) SetBaggageItem(restrictedKey, value string) opentracing.Span

func (*Span) SetOperationName

func (s *Span) SetOperationName(operationName string) opentracing.Span

func (*Span) SetTag

func (s *Span) SetTag(key string, value interface{}) opentracing.Span

func (*Span) Tracer

func (s *Span) Tracer() opentracing.Tracer

type SpanBuilder

type SpanBuilder struct {
	// contains filtered or unexported fields
}

func (SpanBuilder) Build

func (b SpanBuilder) Build() opentracing.Span

func (SpanBuilder) BuildWithContext

func (b SpanBuilder) BuildWithContext(ctx context.Context) (opentracing.Span, context.Context)

func (SpanBuilder) ExtractBinary

func (b SpanBuilder) ExtractBinary(carrier []byte) SpanBuilder

func (SpanBuilder) ExtractHeaders

func (b SpanBuilder) ExtractHeaders(carrier http.Header) SpanBuilder

func (SpanBuilder) ExtractMap

func (b SpanBuilder) ExtractMap(carrier map[string]string) SpanBuilder

func (SpanBuilder) WithName

func (b SpanBuilder) WithName(name string) SpanBuilder

type Tracer

type Tracer struct {
	opentracing.Tracer
	// contains filtered or unexported fields
}

func NewTracer

func NewTracer(configuration *config.Configuration, options ...config.Option) (*Tracer, error)

func (*Tracer) Close

func (c *Tracer) Close() error

func (*Tracer) NewSpan

func (c *Tracer) NewSpan() SpanBuilder

func (*Tracer) OpenTracer

func (c *Tracer) OpenTracer() opentracing.Tracer

type WarnLogger

type WarnLogger interface {
	Warnf(template string, args ...interface{})
}

Directories

Path Synopsis
internal
otgrpc
Package otgrpc provides OpenTracing support for any gRPC client or server.
Package otgrpc provides OpenTracing support for any gRPC client or server.

Jump to

Keyboard shortcuts

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