telemetry

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, cfg Config) (func(), error)

Init initializes OpenTelemetry with the given configuration. Returns a cleanup function that should be called on shutdown.

Types

type Config

type Config struct {
	// ServiceName is the name of the service for telemetry identification
	ServiceName string `mapstructure:"service_name" default:"compass"`

	// OpenTelemetry configuration
	OpenTelemetry OpenTelemetryConfig `mapstructure:"open_telemetry"`
}

type OpenTelemetryConfig

type OpenTelemetryConfig struct {
	// Enabled enables OpenTelemetry instrumentation
	Enabled bool `mapstructure:"enabled" default:"false"`

	// CollectorAddr is the address of the OTLP collector
	CollectorAddr string `mapstructure:"collector_addr" default:"localhost:4317"`

	// PeriodicReadInterval is the interval for periodic metric reads
	PeriodicReadInterval time.Duration `mapstructure:"periodic_read_interval" default:"15s"`

	// TraceSampleProbability is the probability of sampling traces (0.0 to 1.0)
	TraceSampleProbability float64 `mapstructure:"trace_sample_probability" default:"1"`
}

Jump to

Keyboard shortcuts

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