otel

package
v0.22.151 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Overview

Package otel provides OpenTelemetry integration for Skipper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, o *Options) (shutdown func(context.Context) error, err error)

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_BSP_MAX_QUEUE_SIZE
  • OTEL_BSP_MAX_EXPORT_BATCH_SIZE
  • OTEL_BSP_SCHEDULE_DELAY
  • OTEL_BSP_EXPORT_TIMEOUT

See:

Types

type BatchSpanProcessor

type BatchSpanProcessor struct {
	ScheduleDelay      time.Duration `yaml:"scheduleDelay"`
	ExportTimeout      time.Duration `yaml:"exportTimeout"`
	MaxQueueSize       int           `yaml:"maxQueueSize"`
	MaxExportBatchSize int           `yaml:"maxExportBatchSize"`
}

type ExporterOtlp

type ExporterOtlp struct {
	Protocol string            `yaml:"protocol"`
	Endpoint string            `yaml:"endpoint"`
	Headers  map[string]string `yaml:"headers"`
}

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"`
}

Options configure OpenTelemetry pipeline.

Jump to

Keyboard shortcuts

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