Documentation
¶
Overview ¶
Package node wires the node agent role: scrape, logs, rules, findings, and delivery to the coordinator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version string
Version is the agent release version, set by the binary from its build flags.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is one node agent.
type Deps ¶
type Deps struct {
Kube kubernetes.Interface
// Roots overrides the trust roots from cfg.Trust.
Roots *bundle.Roots
Clock func() time.Time
NodeIP string
// PodName is the agent's own pod, whose log streams are never tailed.
PodName string
// KubeletURL overrides https://NODE_IP:kubeletPort.
KubeletURL string
KubeletTokenFile string
KubeletCAFile string
// Coordinator fields left zero are filled from cfg.Coordinator.
Coordinator nodeapi.ClientOptions
Executor TaskExecutor
AgentVersion string
// Process overrides the identity read from /proc/self/status.
Process *privdrop.Identity
Logger *slog.Logger
Timing Timing
}
Deps injects the external dependencies of an Agent.
type Status ¶
type Status struct {
Node string
AgentVersion string
Process nodeapi.Process
BundleVersion string
TargetBundle string
BundleError string
Warming bool
Coverage map[string]string
Rules []engine.RuleState
Queue spool.QueueUsage
Acked uint64
Dropped string
DeliveryError string
OpenFindings int
Disk disk.Report
TSDB tsdb.Stats
Targets []scrape.TargetStatus
Logs logs.Stats
Evidence evidence.Stats
}
Status is a snapshot of a running agent.
type TaskExecutor ¶
TaskExecutor runs coordinator investigation tasks against local telemetry.
type Timing ¶
type Timing struct {
EvalTick time.Duration // how often due rules are checked (default 1s)
Register time.Duration // default 30s
Facts time.Duration // metric facts interval (default 60s)
KubeRefresh time.Duration // re-stamping of kube_* series (default 60s)
DiskCheck time.Duration // default 30s
RetryMin time.Duration // delivery backoff start (default 1s)
RetryMax time.Duration // delivery backoff ceiling (default 30s)
TSDBBlock time.Duration // TSDB block duration (default tsdb.DefaultBlockDuration)
TSDBWALBytes int // TSDB WAL segment size (default tsdb.DefaultWALSegmentBytes)
LogPoll time.Duration // default logs.DefaultPollInterval
LogCheckpoint time.Duration // default logs.DefaultCheckpointInterval
}
Timing holds loop cadences; zero values take the defaults.
Click to show internal directories.
Click to hide internal directories.