status

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: Apache-2.0 Imports: 63 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"status",
	"Collects and provides Cilium status information",

	cell.Config(Config{
		StatusCollectorWarningThreshold:  15 * time.Second,
		StatusCollectorFailureThreshold:  1 * time.Minute,
		StatusCollectorInterval:          5 * time.Second,
		StatusCollectorProbeCheckTimeout: 5 * time.Minute,
		StatusCollectorStackdumpPath:     "/run/cilium/state/agent.stack.gz",
	}),
	cell.Provide(newStatusCollector),
	cell.Provide(newStatusAPIHandler),
	cell.Invoke(func(StatusCollector) {}),
)

Cell provides the Cilium status collector that is responsible for collecting and providing the status of different Cilium modules.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	lock.RWMutex // protects staleProbes and probeStartTime
	// contains filtered or unexported fields
}

Collector concurrently runs probes used to check status of various subsystems

func (*Collector) Close

func (c *Collector) Close()

Close exits all probes and shuts down the collector

func (*Collector) GetStaleProbes

func (c *Collector) GetStaleProbes() map[string]time.Time

GetStaleProbes returns a map of stale probes which key is a probe name and value is a time when the last instance of the probe has been started.

A probe is declared stale if it hasn't returned in FailureThreshold.

func (*Collector) StartProbes added in v1.18.0

func (c *Collector) StartProbes(probes []Probe)

StartProbes starts the given probes.

Each probe runs in a separate goroutine.

func (*Collector) WaitForFirstRun added in v1.17.0

func (c *Collector) WaitForFirstRun(ctx context.Context) error

WaitForFirstRun blocks until all probes have been executed at least once, or the context gets canceled.

type Config

type Config struct {
	StatusCollectorWarningThreshold  time.Duration
	StatusCollectorFailureThreshold  time.Duration
	StatusCollectorInterval          time.Duration
	StatusCollectorProbeCheckTimeout time.Duration
	StatusCollectorStackdumpPath     string
}

Config is the collector configuration

func (Config) Flags added in v1.18.0

func (r Config) Flags(flags *pflag.FlagSet)

type GetHealthzHandler added in v1.18.0

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

func (*GetHealthzHandler) Handle added in v1.18.0

type Probe

type Probe struct {
	Name string

	Probe func(ctx context.Context) (any, error)

	// OnStatusUpdate is called whenever the status of the probe changes
	OnStatusUpdate func(status Status)

	// Interval allows to specify a probe specific interval that can be
	// mutated based on whether the probe is failing or based on external
	// factors such as current cluster size
	Interval func(failures int) time.Duration
	// contains filtered or unexported fields
}

Probe is run by the collector at a particular interval between invocations

type Status

type Status struct {
	// Data is non-nil when the probe has completed successfully. Data is
	// set to the value returned by Probe()
	Data any

	// Err is non-nil if either the probe file or the Failure or Warning
	// threshold has been reached
	Err error

	// StaleWarning is true once the WarningThreshold has been reached
	StaleWarning bool
}

Status is passed to a probe when its state changes

type StatusCollector added in v1.18.0

type StatusCollector interface {
	GetStatus(brief bool, requireK8sConnectivity bool) models.StatusResponse
}

Jump to

Keyboard shortcuts

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