Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
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
StartProbes starts the given probes.
Each probe runs in a separate goroutine.
type Config ¶
type Config struct {
StatusCollectorWarningThreshold time.Duration
StatusCollectorFailureThreshold time.Duration
StatusCollectorInterval time.Duration
StatusCollectorProbeCheckTimeout time.Duration
StatusCollectorStackdumpPath string
}
Config is the collector configuration
type GetHealthzHandler ¶ added in v1.18.0
type GetHealthzHandler struct {
// contains filtered or unexported fields
}
func (*GetHealthzHandler) Handle ¶ added in v1.18.0
func (h *GetHealthzHandler) Handle(params daemonapi.GetHealthzParams) middleware.Responder
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
}