tracing

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 25 Imported by: 131

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TraceIDFromContext

func TraceIDFromContext(c context.Context, requireSampled bool) string

Types

type EventValue

type EventValue struct {
	Str string
	Num int64
}

type Opentelemetry

type Opentelemetry struct {
	Cfg *setting.Cfg
	// contains filtered or unexported fields
}

func (*Opentelemetry) Inject

func (ots *Opentelemetry) Inject(ctx context.Context, header http.Header, _ Span)

func (*Opentelemetry) Run

func (ots *Opentelemetry) Run(ctx context.Context) error

func (*Opentelemetry) Start

func (ots *Opentelemetry) Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, Span)

type OpentelemetrySpan

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

func (OpentelemetrySpan) AddEvents

func (s OpentelemetrySpan) AddEvents(keys []string, values []EventValue)

func (OpentelemetrySpan) End

func (s OpentelemetrySpan) End()

func (OpentelemetrySpan) RecordError

func (s OpentelemetrySpan) RecordError(err error, options ...trace.EventOption)

func (OpentelemetrySpan) SetAttributes

func (s OpentelemetrySpan) SetAttributes(key string, value interface{}, kv attribute.KeyValue)

func (OpentelemetrySpan) SetName

func (s OpentelemetrySpan) SetName(name string)

func (OpentelemetrySpan) SetStatus

func (s OpentelemetrySpan) SetStatus(code codes.Code, description string)

type Opentracing

type Opentracing struct {
	Cfg *setting.Cfg
	// contains filtered or unexported fields
}

func (*Opentracing) Inject

func (ts *Opentracing) Inject(ctx context.Context, header http.Header, span Span)

func (*Opentracing) Run

func (ts *Opentracing) Run(ctx context.Context) error

func (*Opentracing) Start

func (ts *Opentracing) Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, Span)

type OpentracingSpan

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

func (OpentracingSpan) AddEvents

func (s OpentracingSpan) AddEvents(keys []string, values []EventValue)

func (OpentracingSpan) End

func (s OpentracingSpan) End()

func (OpentracingSpan) RecordError

func (s OpentracingSpan) RecordError(err error, options ...trace.EventOption)

func (OpentracingSpan) SetAttributes

func (s OpentracingSpan) SetAttributes(key string, value interface{}, kv attribute.KeyValue)

func (OpentracingSpan) SetName

func (s OpentracingSpan) SetName(name string)

func (OpentracingSpan) SetStatus

func (s OpentracingSpan) SetStatus(code codes.Code, description string)

type Span

type Span interface {
	End()
	SetAttributes(key string, value interface{}, kv attribute.KeyValue)
	SetName(name string)
	SetStatus(code codes.Code, description string)
	RecordError(err error, options ...trace.EventOption)
	AddEvents(keys []string, values []EventValue)
}

type Tracer

type Tracer interface {
	Run(context.Context) error
	Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, Span)
	Inject(context.Context, http.Header, Span)
}

func InitializeForBus

func InitializeForBus() Tracer

func InitializeTracerForTest

func InitializeTracerForTest() (Tracer, error)

func ProvideService

func ProvideService(cfg *setting.Cfg) (Tracer, error)

Jump to

Keyboard shortcuts

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