Enable log checkpoints for the node Collector
The node Collector’s filelog and journald receivers start at the end of
each file and journal, and keep their read positions in memory. When a
Collector restarts or its Pod is replaced, for example during a chart upgrade,
lines written while it was down are skipped. This guide stores the read
positions in a directory on each node with the file_storage extension, which
the default Collector image includes, so the replacement Collector resumes
where the previous one stopped. This uses the receivers’ own
offset tracking
and
cursor tracking.
The values example contains every setting below.
Enable checkpoints
Configure the Helm repositories as shown in Getting started. From the repository root, build the chart dependencies, then install or upgrade with the values example. Edit the release name and namespace below to match your installation:
It mounts a host directory into the Collector:
Volumes and mounts are lists, which Helm replaces, so the example restates the
chart’s defaults from nktp/deploy/charts/nktp/values.yaml. Merge the lists by hand when
combining it with another example, such as
Enable host process metrics.
It then adds the extension and sets storage on every log receiver:
service.extensions restates health_check for the same reason. Add storage
to any log receiver you add. Each receiver’s checkpoints are stored under its
name, so renaming a receiver starts it again from start_at.
What is kept
The host directory survives Collector restarts, Pod replacement, and node
reboots. start_at still applies to files and journals with no checkpoint,
such as new Pod log files.
Lines are still lost when the kubelet rotates a log file away before the Collector reads it, or when the node itself is replaced.
Security and cleanup
The node Collector runs as root, so it can write to the host directory. Keep the path dedicated to NVKE telemetry pipeline (NKTP). The directory stays on each node after NKTP is uninstalled; remove it from the nodes when it is no longer needed.
Each node has one directory. Use a different hostPath.path for each NKTP
release when running more than one on the same nodes.
Verify
Set the node name below to a node running the Collector, then list its checkpoint files:
There is one file per log receiver, named after the receiver.