tracer

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 15 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTracerProvider

func NewTracerProvider(service, host, development string, port int, sampler trace.Sampler) (*trace.TracerProvider, error)

func SemVersion

func SemVersion() string

SemVersion is the semantic version to be supplied to tracer/meter creation.

func Version

func Version() string

Version is the current release version of the gin instrumentation.

Types

type FallbackSampler added in v0.2.4

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

FallbackSampler does the sampling at a rate of 1 req/sec and 5% of additional requests.

func NewFallbackSampler added in v0.2.4

func NewFallbackSampler(fraction float64) *FallbackSampler

NewFallbackSampler returns a FallbackSampler which samples 1 req/sec and additional 5% of requests using traceIDRatioBasedSampler.

func (*FallbackSampler) Description added in v0.2.4

func (fs *FallbackSampler) Description() string

Description returns description of the sampler being used.

func (*FallbackSampler) ShouldSample added in v0.2.4

func (fs *FallbackSampler) ShouldSample(parameters sdktrace.SamplingParameters) sdktrace.SamplingResult

ShouldSample implements the logic of borrowing 1 req/sec and then use traceIDRatioBasedSampler to sample 5% of additional requests.

type Jaeger

type Jaeger struct{}

Jaeger propagator serializes SpanContext to/from Jaeger Headers

Jaeger format:

uber-tracer-id: {tracer-id}:{span-id}:{parent-span-id}:{flags}

func (Jaeger) Extract

func (jaeger Jaeger) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context

Extract extracts a context from the carrier if it contains Jaeger headers.

func (Jaeger) Fields

func (jaeger Jaeger) Fields() []string

func (Jaeger) Inject

func (jaeger Jaeger) Inject(ctx context.Context, carrier propagation.TextMapCarrier)

Inject injects a context to the carrier following jaeger format. The parent span ID is set to an dummy parent span id as the most implementations do.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option specifies instrumentation configuration options.

func WithName added in v0.2.1

func WithName(name string) Option

WithName name default Service

func WithPropagators

func WithPropagators(propagators propagation.TextMapPropagator) Option

WithPropagators specifies propagators to use for extracting information from the HTTP requests. If none are specified, global ones will be used.

func WithProvider added in v0.2.1

func WithProvider(provider oteltrace.TracerProvider) Option

WithProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.

type Server

type Server struct {
	Tracer         oteltrace.Tracer
	TracerProvider oteltrace.TracerProvider
	Propagators    propagation.TextMapPropagator
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Server

New returns middleware that will tracer incoming requests. The service parameter should describe the name of the (virtual) webserve handling the request.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

Jump to

Keyboard shortcuts

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