telemetry

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package telemetry comment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSegmentIOClient added in v1.3.0

func SetSegmentIOClient(c analytics.Client)

func TrackClusterDeploymentCreate

func TrackClusterDeploymentCreate(id, clusterDeploymentID, template string, dryRun bool) error

Types

type Collector added in v1.3.0

type Collector interface {
	// Called periodically by the controller to trigger a collection round.
	Collect(context.Context) error
	// Called once during shutdown to release resources and flush final data.
	Close(context.Context) error
}

Collector is the generic interface for a telemetry collector.

type Config added in v1.3.0

type Config struct {
	MgmtClient       client.Client
	Mode             Mode
	SystemNamespace  string
	LocalBaseDir     string
	Interval         time.Duration
	JitterPercentage uint // ie 10%
	Concurrency      int
}

Config configurates Telemetry Collector.

func (*Config) BindFlags added in v1.3.0

func (c *Config) BindFlags(fs *flag.FlagSet)

type Mode added in v1.3.0

type Mode string //nolint:recvcheck // invalid in this case

Mode defines the way telemetry is collected and stored.

const (
	ModeDisabled Mode = "disabled"
	ModeLocal    Mode = "local"
	ModeOnline   Mode = "online"
)

func (*Mode) Set added in v1.3.0

func (m *Mode) Set(flagValue string) error

func (Mode) String added in v1.3.0

func (m Mode) String() string

type Opt added in v1.3.0

type Opt func(*Config)

Opt is an optional function to change the Config.

func UseFlagOptions added in v1.3.0

func UseFlagOptions(in *Config) Opt

UseFlagOptions configures the telemetry runner to use the Config set by parsing telemetry options flags from the CLI.

Note: not all options can be set via flags, e.g. MgmtClient cannot be set in that manner.

cfg := &telemetry.Config{MgmtClient: cl}
cfg.BindFlags(flag.CommandLine)
flag.Parse()
runner, err := telemetry.NewRunner(telemetry.UseFlagOptions(cfg))

type Runner added in v1.3.0

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

Runner is a controller-runtime Runnable that periodically invokes the tracker.

func NewRunner added in v1.3.0

func NewRunner(cfg *Config) (*Runner, error)

NewRunner constructs a new Runner instance.

func (*Runner) Start added in v1.3.0

func (r *Runner) Start(ctx context.Context) error

Directories

Path Synopsis
Package collector holds different implementation of telemetry data collectors.
Package collector holds different implementation of telemetry data collectors.

Jump to

Keyboard shortcuts

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