telemetryexport

package
v0.19.1246 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectorConfig

func CollectorConfig(cfg Config, endpoint string, attributes map[string]string) ([]byte, error)

CollectorConfig produces the same persistent OTLP pipelines for runner and standalone collectors. Literal metadata and local paths are escaped against Collector environment expansion.

Types

type Collector

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

Collector owns a child process and its temporary config. The supervisor owns restart policy; Done reports exit, and Stop joins shutdown and removes the config.

func StartCollector

func StartCollector(ctx context.Context, previous *Collector, options CollectorOptions) (*Collector, error)

StartCollector replaces the previous child only after preparing the new config. Always retain the returned handle: a preparation error leaves the previous child running, while a failed launch returns nil after cleanup. Cancellation terminates the child with SIGTERM, escalating to SIGKILL after five seconds. Callers must eventually Stop the handle to join exit and remove its temporary configuration.

func (*Collector) Done

func (c *Collector) Done() <-chan struct{}

func (*Collector) StartedAt

func (c *Collector) StartedAt() time.Time

func (*Collector) Stop

func (c *Collector) Stop()

Stop is safe for a nil child, and waits for process exit before removing its config.

type CollectorOptions

type CollectorOptions struct {
	Binary      string
	Config      []byte
	HealthURL   string
	Environment []string
	Args        []string
	Logger      *zap.Logger
}

CollectorOptions contains local process configuration. Only explicitly supplied environment values and allowlisted TLS/proxy settings reach the Collector.

type Config

type Config struct {
	StorageDirectory string
	TokenDirectory   string
	GRPCAddress      string
	HTTPAddress      string
	HealthAddress    string
	// CAFile supplements, rather than replaces, the system trust pool
	// (including SSL_CERT_FILE and SSL_CERT_DIR roots) for relay connections.
	CAFile string
}

Config controls local listeners and state, not the remotely selected relay destination. TokenDirectory must be dedicated to relay credentials; disabling export removes it.

func DefaultConfig

func DefaultConfig(directory string) Config

type Options

type Options struct {
	InstallID       string
	Binary          string
	Config          Config
	Client          telemetryAccessTokenClient
	Logger          *zap.Logger
	InitialSettings *Settings
	FetchSettings   func(context.Context) (Settings, error)
	OnEnabled       func(bool)
}

Options separates control-plane settings and host lifecycle integration from token renewal, reconciliation, and Collector process supervision. An empty InstallID makes the supervisor ineligible: Run removes stale credentials and returns without fetching settings. A nil InitialSettings fetches settings before the first reconciliation.

type Settings

type Settings struct {
	Enabled            bool
	RelayEndpoint      string
	ResourceAttributes map[string]string
}

Settings is the remotely selected relay destination and resource metadata. Adapters map control-plane responses into Settings at their boundary.

type VendorSupervisor

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

func NewVendor

func NewVendor(options Options) *VendorSupervisor

func (*VendorSupervisor) Ready

func (s *VendorSupervisor) Ready() bool

Ready distinguishes a healthy, intentionally disabled controller from one that has not loaded settings or cannot start its enabled Collector.

func (*VendorSupervisor) Run

func (s *VendorSupervisor) Run(ctx context.Context)

Run polls settings even while forwarding is disabled. It stops the child process and removes credentials before every return; callers own cancellation and must join Run. Call once per supervisor.

Jump to

Keyboard shortcuts

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