tracing

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract added in v0.0.11

func Extract(ctx context.Context, propagators propagation.TextMapPropagator) context.Context

Extract returns the correlation context and span context that another service encoded in the gRPC metadata object with Inject. This function is meant to be used on incoming requests.

func Inject added in v0.0.11

Inject injects correlation context and span context into the gRPC metadata object. This function is meant to be used on outgoing requests.

func TraceIDFromContext

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

Types

type Option

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

Option specifies instrumentation configuration options.

func WithAddress

func WithAddress(address string) Option

func WithAttributes

func WithAttributes(attrs ...attribute.KeyValue) Option

WithAttributes specifies additional attributes to be added to the span.

func WithBatchTimeout added in v0.0.2

func WithBatchTimeout(delay time.Duration) Option

WithBatchTimeout returns a Option that configures the maximum delay allowed for a BatchSpanProcessor before it will export any held span (whether the queue is full or not).

func WithBlocking added in v0.0.2

func WithBlocking() Option

WithBlocking returns a Option that configures a BatchSpanProcessor to wait for enqueue operations to succeed instead of dropping data when the queue is full.

func WithExportTimeout added in v0.0.2

func WithExportTimeout(timeout time.Duration) Option

WithExportTimeout returns a Option that configures the amount of time a BatchSpanProcessor waits for an exporter to export before abandoning the export.

func WithExporter

func WithExporter(exporter string) Option

func WithMaxExportBatchSize added in v0.0.2

func WithMaxExportBatchSize(size int) Option

WithMaxExportBatchSize returns a Option that configures the maximum export batch size allowed for a BatchSpanProcessor.

func WithMaxQueueSize added in v0.0.2

func WithMaxQueueSize(size int) Option

WithMaxQueueSize returns a Option that configures the maximum queue size allowed for a BatchSpanProcessor.

func WithSamplerParam

func WithSamplerParam(p float64) Option

func WithServiceName

func WithServiceName(service string) Option

func WithServiceVersion

func WithServiceVersion(version string) Option

func WithWriter added in v0.0.9

func WithWriter(w io.Writer) Option

WithWriter sets the export stream destination.

type TracerProvider added in v0.0.7

type TracerProvider interface {
	embedded.TracerProvider

	Tracer(name string, options ...trace.TracerOption) trace.Tracer
	Shutdown(ctx context.Context) error
}

func NewProfilingTracerProvider

func NewProfilingTracerProvider(tp TracerProvider) TracerProvider

NewProfilingTracerProvider creates a new tracer provider that annotates pprof samples with span_id label. This allows to establish a relationship between pprof profiles and reported tracing spans.

type Tracing

type Tracing struct {
	embedded.TracerProvider
	// contains filtered or unexported fields
}

func New

func New(log *wlog.Logger, service string, opts ...Option) (*Tracing, error)

func (*Tracing) Shutdown

func (t *Tracing) Shutdown(ctx context.Context) error

func (*Tracing) Tracer added in v0.0.7

func (t *Tracing) Tracer(name string, options ...trace.TracerOption) trace.Tracer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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