Documentation ¶
Overview ¶
Package tracing implements the tracing subsystem of Grafana Alloy. 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 ¶
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 ¶
func WrapTracer ¶
func WrapTracer(inner trace.TracerProvider, componentID string) trace.TracerProvider
WrapTracer returns a new trace.TracerProvider which will inject the provided componentID as an attribute to each span.
func WrapTracerForLoader ¶
func WrapTracerForLoader(inner trace.TracerProvider, componentID string) trace.TracerProvider
WrapTracerForLoader returns a new trace.TracerProvider which will inject the provided controller id as an attribute to each span.
Types ¶
type JaegerRemoteSamplerOptions ¶
type JaegerRemoteSamplerOptions struct { URL string `alloy:"url,attr,optional"` MaxOperations int `alloy:"max_operations,attr,optional"` RefreshInterval time.Duration `alloy:"refresh_interval,attr,optional"` }
func (*JaegerRemoteSamplerOptions) SetToDefault ¶
func (opts *JaegerRemoteSamplerOptions) SetToDefault()
SetToDefault implements syntax.Defaulter.
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 `alloy:"sampling_fraction,attr,optional"` // Sampler holds optional samplers to configure on top of the sampling // fraction. Sampler SamplerOptions `alloy:"sampler,block,optional"` // WriteTo holds a set of OpenTelemetry Collector consumers where internal // traces should be sent. WriteTo []otelcol.Consumer `alloy:"write_to,attr,optional"` }
Options control the tracing subsystem.
func (*Options) SetToDefault ¶
func (opts *Options) SetToDefault()
SetToDefault implements syntax.Defaulter.
type SamplerOptions ¶
type SamplerOptions struct {
JaegerRemote *JaegerRemoteSamplerOptions `alloy:"jaeger_remote,block,optional"`
}
type Tracer ¶
type Tracer struct { trace.TracerProvider // contains filtered or unexported fields }
Tracer is the tracing subsystem of Grafana Alloy. It implements trace.TracerProvider and can be used to forward internally generated traces to a OpenTelemetry Collector-compatible Alloy component.
func (*Tracer) Run ¶
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.
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
jaegerremote
Package jaegerremote implements the Jaeger Remote protocol.
|
Package jaegerremote implements the Jaeger Remote protocol. |