Documentation
¶
Overview ¶
Package otel provides OpenTelemetry integration for Skipper.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init bootstraps the OpenTelemetry pipeline using environment variables and provided options. Make sure to call shutdown for proper cleanup if err is nil.
Supported environment variables:
- OTEL_TRACES_EXPORTER
- OTEL_EXPORTER_OTLP_PROTOCOL
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_HEADERS
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_PROPAGATORS
- OTEL_TRACES_SAMPLER
- OTEL_TRACES_SAMPLER_ARG
- OTEL_BSP_MAX_QUEUE_SIZE
- OTEL_BSP_MAX_EXPORT_BATCH_SIZE
- OTEL_BSP_SCHEDULE_DELAY
- OTEL_BSP_EXPORT_TIMEOUT
See:
- go.opentelemetry.io/contrib/exporters/autoexport
- go.opentelemetry.io/contrib/propagators/autoprop.
- https://opentelemetry.io/docs/languages/sdk-configuration/general/
- https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
- https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md#environment-variables
Types ¶
type BatchSpanProcessor ¶
type ExporterOtlp ¶
type Options ¶
type Options struct {
// Initialized indicates whether the OpenTelemetry pipeline has been initialized externally.
// If true [Init] returns immediately without doing anything.
Initialized bool `yaml:"-"`
TracesExporter string `yaml:"tracesExporter"`
ExporterOtlp ExporterOtlp `yaml:"exporterOtlp"`
ResourceAttributes map[string]string `yaml:"resourceAttributes"`
Propagators []string `yaml:"propagators"`
BatchSpanProcessor BatchSpanProcessor `yaml:"batchSpanProcessor"`
// Sampler configures the Sampler used by the TracerProvider to decide
// whether a span is recorded and marked as sampled.
//
// Supported values, matching the OTEL_TRACES_SAMPLER environment variable:
//
// - always_on
// - always_off
// - traceidratio
// - parentbased_always_on (default)
// - parentbased_always_off
// - parentbased_traceidratio
//
// If empty, the sampler is taken from the OTEL_TRACES_SAMPLER (and
// OTEL_TRACES_SAMPLER_ARG) environment variables, falling back to the SDK
// default of parentbased_always_on if those are not set either.
//
// Note that "parentbased_*" samplers respect the sampled flag of an
// incoming traceparent header and will stop sampling (and therefore stop
// propagating sampled=1) for the rest of the trace once an upstream hop
// marks it as not sampled. Use "always_on" to make skipper always record
// and always propagate sampled=1 regardless of the incoming trace context.
Sampler string `yaml:"sampler"`
// SamplerArg configures the argument for the Sampler, if applicable.
// Only used by the "traceidratio" and "parentbased_traceidratio" samplers,
// where it is the sampling ratio in the range [0.0, 1.0].
//
// If empty, the argument is taken from the OTEL_TRACES_SAMPLER_ARG
// environment variable.
SamplerArg string `yaml:"samplerArg"`
}
Options configure OpenTelemetry pipeline.
Click to show internal directories.
Click to hide internal directories.