tracing

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

README

go-tracing

Configurations for distributed tracing in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractSpanContextFromRequest

func ExtractSpanContextFromRequest(r *http.Request) opentracing.SpanContext

func Initialize

func Initialize(options ...TracerOptionFunc) (io.Closer, error)

Initialize create an instance of Jaeger Tracer and sets it as GlobalTracer.

Types

type Info

type Info struct {
	OperationName string
	TraceID       string
	SpanID        string
	ParentID      string
	IsSampled     bool
}

type SamplerType

type SamplerType string
const (
	ConstantSampler      SamplerType = jaeger.SamplerTypeConst
	ProbabilisticSampler SamplerType = jaeger.SamplerTypeProbabilistic
	RateLimitingSampler  SamplerType = jaeger.SamplerTypeRateLimiting
	RemoteSampler        SamplerType = jaeger.SamplerTypeRemote
)

type Span

type Span struct {
	opentracing.Span
}

func SpanFromContext

func SpanFromContext(ctx context.Context) *Span

func StartSpanFromContext

func StartSpanFromContext(ctx context.Context, options ...SpanOptionFunc) (*Span, context.Context)

func StartSpanFromRequest

func StartSpanFromRequest(r *http.Request) (*Span, context.Context)

func (*Span) HandleError

func (s *Span) HandleError(err error) error

func (*Span) Info

func (s *Span) Info() *Info

func (*Span) Panic

func (s *Span) Panic(err interface{})

func (*Span) SetError

func (s *Span) SetError(err error)

func (*Span) SetHTTPResponseStatus

func (s *Span) SetHTTPResponseStatus(status int)

func (*Span) String

func (s *Span) String() string

type SpanOptionFunc

type SpanOptionFunc func(*SpanOptions)

func WithCustomResource

func WithCustomResource(resource types.NamespacedName) SpanOptionFunc

func WithOperationName

func WithOperationName(operation string) SpanOptionFunc

type SpanOptions

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

func (*SpanOptions) Operation

func (o *SpanOptions) Operation() string

type TracerOptionFunc

type TracerOptionFunc func(*config.Configuration) error

func WithEndpoint

func WithEndpoint(endpoint string) TracerOptionFunc

func WithSamplerParam

func WithSamplerParam(samplerParam float64) TracerOptionFunc

func WithSamplerType

func WithSamplerType(samplerType SamplerType) TracerOptionFunc

func WithServiceName

func WithServiceName(service string) TracerOptionFunc

Jump to

Keyboard shortcuts

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