tracing

package
v0.31.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package tracing implements the tracing subsystem of Grafana Agent Flow. The tracing subsystem exposes a trace.TraceProvider which accepts traces and forwards them to a running component for further processing.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultOptions = Options{
		SamplingFraction: 0.1,
		WriteTo:          []otelcol.Consumer{},
	}

	DefaultJaegerRemoteSamplerOptions = JaegerRemoteSamplerOptions{
		URL:             "http://127.0.0.1:5778/sampling",
		MaxOperations:   256,
		RefreshInterval: time.Minute,
	}
)

Defaults for all Options structs.

Functions

This section is empty.

Types

type JaegerRemoteSamplerOptions added in v0.30.0

type JaegerRemoteSamplerOptions struct {
	URL             string        `river:"url,attr,optional"`
	MaxOperations   int           `river:"max_operations,attr,optional"`
	RefreshInterval time.Duration `river:"refresh_interval,attr,optional"`
}

func (*JaegerRemoteSamplerOptions) UnmarshalRiver added in v0.30.0

func (opts *JaegerRemoteSamplerOptions) UnmarshalRiver(f func(interface{}) error) error

UnmarshalRiver implements river.Unmarshaler.

type Options

type Options struct {
	// SamplingFraction determines which rate of traces to sample. A value of 1
	// means to keep 100% of traces. A value of 0 means to keep 0% of traces.
	SamplingFraction float64 `river:"sampling_fraction,attr,optional"`

	// Sampler holds optional samplers to configure on top of the sampling
	// fraction.
	Sampler SamplerOptions `river:"sampler,block,optional"`

	// WriteTo holds a set of OpenTelemetry Collector consumers where internal
	// traces should be sent.
	WriteTo []otelcol.Consumer `river:"write_to,attr,optional"`
}

Options control the tracing subsystem.

func (*Options) UnmarshalRiver added in v0.30.0

func (opts *Options) UnmarshalRiver(f func(interface{}) error) error

UnmarshalRiver implements river.Unmarshaler.

type SamplerOptions added in v0.30.0

type SamplerOptions struct {
	JaegerRemote *JaegerRemoteSamplerOptions `river:"jaeger_remote,block,optional"`
}

type Tracer

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

Tracer is the tracing subsystem of Grafana Agent Flow. It implements trace.TracerProvider and can be used to forward internally generated traces to a OpenTelemetry Collector-compatible Flow component.

func New

func New(cfg Options) (*Tracer, error)

New creates a new tracing subsystem. Call Run to start the tracing subsystem.

func (*Tracer) Run

func (t *Tracer) Run(ctx context.Context) error

Run starts the tracing subsystem and runs it until the provided context is canceled. If the tracing subsystem could not be started, an error is returned.

Run returns no error upon normal shutdown.

func (*Tracer) Tracer

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

func (*Tracer) Update

func (t *Tracer) Update(opts Options) error

Update provides a new config to the tracing subsystem.

Directories

Path Synopsis
internal
jaegerremote
Package jaegerremote implements the Jaeger Remote protocol.
Package jaegerremote implements the Jaeger Remote protocol.

Jump to

Keyboard shortcuts

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