trace

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogBackend

func LogBackend(span opentracing.Span, r *bfe_basic.Request)

LogBackend used to log backend info

func LogEventf

func LogEventf(span opentracing.Span, format string, args ...interface{})

LogEventf logs an event to the span in the request context.

func LogRequest

func LogRequest(span opentracing.Span, r *bfe_http.Request)

LogRequest used to create span tags from the request.

func LogResponseCode

func LogResponseCode(span opentracing.Span, code int)

LogResponseCode used to log response code in span.

func SetError

func SetError(span opentracing.Span)

SetError flags the span associated with this request as in error.

func SetErrorWithEvent

func SetErrorWithEvent(span opentracing.Span, format string, args ...interface{})

SetErrorWithEvent flags the span associated with this request as in error and log an event.

Types

type Trace

type Trace struct {
	ServiceName string
	// contains filtered or unexported fields
}

func NewTrace

func NewTrace(serviceName string, traceAgent TraceAgent) (*Trace, error)

func (*Trace) Close

func (t *Trace) Close()

Close trace

func (*Trace) Extract

func (t *Trace) Extract(format interface{}, carrier interface{}) (opentracing.SpanContext, error)

Extract delegates to opentracing.Tracer.

func (*Trace) Inject

func (t *Trace) Inject(sm opentracing.SpanContext, format interface{}, carrier interface{}) error

Inject delegates to opentracing.Tracer.

func (*Trace) IsEnabled

func (t *Trace) IsEnabled() bool

IsEnabled determines if Tracer was successfully activated.

func (*Trace) StartSpan

func (t *Trace) StartSpan(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span

StartSpan delegates to opentracing.Tracer.

type TraceAgent

type TraceAgent interface {
	Setup(componentName string) (opentracing.Tracer, io.Closer, error)
}

TraceAgent is an abstraction for trace agent (Zipkin, Jaeger, ...).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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