trace

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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