Skip to content

Host collectors - #2

Merged
solsson merged 12 commits into
mainfrom
host-collectors
Nov 9, 2026
Merged

solsson merged 12 commits into
mainfrom
host-collectors

Conversation

@solsson

@solsson solsson commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Host agent collectors: the pipeline split into collectors that a launcher picks with
node_exporter's flags (--collector.X, --no-collector.X, --collector.disable-defaults),
the defaults being the pipeline as before. HOST_MODE.md, "Collectors" and "Upgrading".

  • images/fluentbit/host/launch.sh, collectors.d/, parts.d/, collectors.defaults;
    the unit runs the launcher
  • itest/host-docker/run.sh: the tarball in Ubuntu containers against versitygw, now a CI job
    on amd64 and arm64
  • docs from a review on a pristine Ubuntu 24.04 VM: upgrading from 0.2.1 (the unit must be
    reinstalled), file modes, auditd, required settings
  • itest fixes from that review (k8s-qa): the docker test's metrics check, and DuckDB secrets
    scoped to each itest bucket

Tested:

  • macOS (arm64), docker backend: ./test.sh itest 200 passed (host phase and journal
    assertions SKIPped: no kvm); checks passed up to vendor.sh check (needs GNU sed);
    itest/host-docker/run.sh 0 failed
  • Ubuntu 24.04 VM (review): 0.2.1 install, upgrade to this branch, an own JSONL collector,
    permissions and drop-ins; findings addressed in be257c0
  • Linux (metalblack): <the reviewer's ./test.sh result on cf945b1, host phase included>

Upgrading from 0.2.1 needs the unit installed again: a stale unit runs and ships nothing.

solsson added a commit that referenced this pull request Oct 26, 2026
…eat, auditd's reload

From a review of PR #2 for ubuntu-on-vlan hosts:

1. /etc/observability-host/required (HOST_REQUIRED_FILE), the installer's
   list of collectors this host requires: the launcher refuses
   --no-collector.<name> of one, as --no-collector.heartbeat, and keeps it
   on with --collector.disable-defaults; a name that is no collector is
   refused.
2. The launcher exports the collectors it runs as HOST_COLLECTORS, and the
   heartbeat adds them to its sample as the label collectors
   (comma-separated), so a receiver can tell from the bucket that a host
   stopped running files or journal. Without the variable the row is as
   before.
3. auditd: a SIGHUP is enough after log_group changes. auditd 3.1.2,
   Ubuntu 24.04's, reopens the log and sets the group in reconfigure();
   its unit has no ExecReload, so systemctl kill -s HUP auditd (read from
   the source and the package, not run on a host).
4. files with HOST_EXTRA_FILES unset: itest/host-docker runs it; the
   trailing empty item in the path draws no warning.

Upgrading also mentions a prefix per version behind a symbolic link.

itest/host-docker: scenarios required-off and no-extra, and the heartbeat's
collectors label for each set of flags. It found that tail warns of a glob
whose directory is missing (/var/log/unattended-upgrades/ in the
container) at every scan; left as it is here.

Tested on macOS (arm64), docker backend:
- images/fluentbit/host/test-launch.sh and test-heartbeat.sh: all passed
- itest/host-docker/run.sh with this tarball: 0 failed
- ./test.sh checks with AI_AGENT and CLAUDECODE unset: passed up to
  vendor.sh check (needs GNU sed); the kustomize builds after it by hand
- ./test.sh itest: all 200 assertions passed; SKIPped as before: the
  journal assertions and the host phase (no /dev/kvm)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
solsson added a commit that referenced this pull request Nov 8, 2026
…eat, auditd's reload

From a review of PR #2 for hosts on Ubuntu 24.04:

1. /etc/observability-host/required (HOST_REQUIRED_FILE), the installer's
   list of collectors this host requires: the launcher refuses
   --no-collector.<name> of one, as --no-collector.heartbeat, and keeps it
   on with --collector.disable-defaults; a name that is no collector is
   refused.
2. The launcher exports the collectors it runs as HOST_COLLECTORS, and the
   heartbeat adds them to its sample as the label collectors
   (comma-separated), so a receiver can tell from the bucket that a host
   stopped running files or journal. Without the variable the row is as
   before.
3. auditd: a SIGHUP is enough after log_group changes. auditd 3.1.2,
   Ubuntu 24.04's, reopens the log and sets the group in reconfigure();
   its unit has no ExecReload, so systemctl kill -s HUP auditd (read from
   the source and the package, not run on a host).
4. files with HOST_EXTRA_FILES unset: itest/host-docker runs it; the
   trailing empty item in the path draws no warning.

Upgrading also mentions a prefix per version behind a symbolic link.

itest/host-docker: scenarios required-off and no-extra, and the heartbeat's
collectors label for each set of flags. It found that tail warns of a glob
whose directory is missing (/var/log/unattended-upgrades/ in the
container) at every scan; left as it is here.

Tested on macOS (arm64), docker backend:
- images/fluentbit/host/test-launch.sh and test-heartbeat.sh: all passed
- itest/host-docker/run.sh with this tarball: 0 failed
- ./test.sh checks with AI_AGENT and CLAUDECODE unset: passed up to
  vendor.sh check (needs GNU sed); the kustomize builds after it by hand
- ./test.sh itest: all 200 assertions passed; SKIPped as before: the
  journal assertions and the host phase (no /dev/kvm)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
solsson and others added 9 commits November 8, 2026 07:38
…docker itest

The host pipeline is split into collectors, one file each in
collectors.d/ (heartbeat, journal, files, node, self), with host.yaml
keeping the service section and the S3 output, and the metrics port a
part (parts.d/serve-metrics.yaml) that only a collector naming it on a
"# needs:" line brings in. The unit runs bin/observability-host-launch,
which takes --collector.<name>, --no-collector.<name> and
--collector.disable-defaults from /etc/observability-host/args and its
command line, writes the configuration that includes the enabled
collectors to the state directory, and execs fluent-bit with it. The
defaults are the previous pipeline: merged as YAML, the files are equal
to main's host.yaml. heartbeat cannot be turned off. A collector that
does not run adds no input, no port and no command.

itest/host-docker/run.sh runs the tarball in Ubuntu containers against
versitygw, as a user a bucket policy allows only PutObject under the
root, with no systemd and no qemu: per set of flags, the collectors
logged, whether the metrics port is open and what it serves, the rows in
the bucket through compactor/sql/raw.sql, and a refused flag stopping the
launcher before fluent-bit.

Tested on macOS (arm64):
- images/fluentbit/host/test-launch.sh: 24 checks pass.
- itest/host-docker/run.sh with the tarball from host/build.sh
  (linux-arm64): 22 checks pass.
- ./test.sh checks with AI_AGENT and CLAUDECODE unset (the duckdb CLI's
  agent mode otherwise changes the output y-obs's acceptance test
  reads): every phase passes up to operator-to-annotations/crds/vendor.sh
  check, which fails on BSD sed (\| in a basic regex) and is unchanged
  here; the kustomize builds after it pass when run by hand.
- Not run: the full ./test.sh, whose host phase needs the qemu backend
  (/dev/kvm), so the unit running the launcher on a systemd host is
  untested here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… end to end

A job per arch on a runner of that arch: the tarball built with
images/fluentbit/host/build.sh in the release's cache scope, then
itest/host-docker/run.sh, which needs neither a cluster nor the qemu node of
test.sh's host phase. HOST_MODE.md says CI runs it.

Tested on macOS (arm64):
- actionlint 1.7.7 (docker): nothing in ci.yaml; release.yaml's two
  findings were there before
- ./test.sh checks with AI_AGENT and CLAUDECODE unset: passed up to
  operator-to-annotations/crds/vendor.sh check, which needs GNU sed; the
  kustomize builds after it pass by hand
- the job itself has not run: it runs on the pull request

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and the required settings

From a review on a pristine Ubuntu 24.04 VM:
- Upgrading: a new prefix and the unit installed again. From 0.2.1 that is
  required: its unit runs fluent-bit with etc/host.yaml, which no longer
  has inputs, so a stale unit runs and ships nothing. A linked unit follows
  the prefix.
- The modes of the files of an install.
- auditd is not on a pristine Ubuntu: apt-get update, install, log_group,
  restart (HOST_MODE.md and the unit's comment).
- The example environment file leaves S3_BUCKET and S3_ENDPOINT empty, so
  the unit refuses to start until they are set, rather than running against
  example.com; the required settings are three, not four.
- The store_dir_limit_size warning at every start is expected.

Tested on macOS (arm64): ./test.sh checks with AI_AGENT and CLAUDECODE
unset passed up to operator-to-annotations/crds/vendor.sh check, which
needs GNU sed (documentation, the env example and the unit's comment only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`sh -c 'grep -q a && grep -q b' <<<"$m"` gives both greps one stdin. The
first reads past what it needs (the whole here-string when it is
small), so the second found nothing and "defaults: 2023 serves node_*
and the agent's own metrics" failed although the port served both. Seen
on a Linux test machine (1 failed of 30). The two series are now looked for in
two here-strings of the same text.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
test.sh and the host phase set s3_endpoint and the keys with SET s3_*.
A persistent DuckDB secret for s3:// on the machine wins over those
settings. One Linux test machine kept one from an earlier local/blobs.sh session
(blobs_itest, endpoint 127.0.0.1:30070, the node bucket's gateway). So
the host phase read s3://host-agent from the node gateway and failed
with NoSuchBucket after 180 s ("gave up waiting for the failed login"),
twice in a row. Both now create a temporary secret scoped to their
bucket, which wins over a broader one, as itest/host-docker already
does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…es ending in /

test.sh reads s3://node-agent-multi too. The secret scoped to
s3://node-agent covered it only because that is a prefix of
node-agent-multi as text; another name for either bucket would have sent
those reads to whatever secret the machine keeps. Each bucket now has a
secret whose scope ends in /, and MULTI_BUCKET is defined beside BUCKET,
before the secrets are written.

Tested on macOS (arm64), docker backend, with the two commits before it
(from k8s-qa, Linux):
- ./test.sh itest with AI_AGENT and CLAUDECODE unset: all 200 assertions
  passed, the multi-cluster phase included; SKIPped as before: the
  journal assertions and the host phase
- itest/host-docker/run.sh with this branch's tarball: 0 failed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b6f6543's check passes the metrics to an inner bash as $1, in single
quotes on purpose; shellcheck reports SC2016 there, and ./test.sh checks,
which shellchecks itest/host-docker/, failed at cf945b1. A directive for
that line.

Tested on macOS (arm64): shellcheck -x -P SCRIPTDIR images/fluentbit/host/*.sh
itest/host/*.sh itest/host-docker/*.sh, as test.sh runs it: clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eat, auditd's reload

From a review of PR #2 for hosts on Ubuntu 24.04:

1. /etc/observability-host/required (HOST_REQUIRED_FILE), the installer's
   list of collectors this host requires: the launcher refuses
   --no-collector.<name> of one, as --no-collector.heartbeat, and keeps it
   on with --collector.disable-defaults; a name that is no collector is
   refused.
2. The launcher exports the collectors it runs as HOST_COLLECTORS, and the
   heartbeat adds them to its sample as the label collectors
   (comma-separated), so a receiver can tell from the bucket that a host
   stopped running files or journal. Without the variable the row is as
   before.
3. auditd: a SIGHUP is enough after log_group changes. auditd 3.1.2,
   Ubuntu 24.04's, reopens the log and sets the group in reconfigure();
   its unit has no ExecReload, so systemctl kill -s HUP auditd (read from
   the source and the package, not run on a host).
4. files with HOST_EXTRA_FILES unset: itest/host-docker runs it; the
   trailing empty item in the path draws no warning.

Upgrading also mentions a prefix per version behind a symbolic link.

itest/host-docker: scenarios required-off and no-extra, and the heartbeat's
collectors label for each set of flags. It found that tail warns of a glob
whose directory is missing (/var/log/unattended-upgrades/ in the
container) at every scan; left as it is here.

Tested on macOS (arm64), docker backend:
- images/fluentbit/host/test-launch.sh and test-heartbeat.sh: all passed
- itest/host-docker/run.sh with this tarball: 0 failed
- ./test.sh checks with AI_AGENT and CLAUDECODE unset: passed up to
  vendor.sh check (needs GNU sed); the kustomize builds after it by hand
- ./test.sh itest: all 200 assertions passed; SKIPped as before: the
  journal assertions and the host phase (no /dev/kvm)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 5 s

tail globs with GLOB_ERR, and glibc aborts a glob whose literal directory
cannot be opened; fluent-bit logs that as a warning and an error at every
refresh (5 s), which the journal collector ships, on any host without
unattended-upgrades. files' path now has /var/log/unattended-upgrade[s]/
*.log: the bracket matches the same directory as a pattern, so glob reads
/var/log and a missing directory is no match, logged at debug.

Checked with glibc on Ubuntu 24.04: the old pattern ABORTED, the new one
NOMATCH without the directory and the same file with it. HOST_MODE.md says
how a HOST_EXTRA_FILES glob avoids it; UPSTREAM.md has the cause.
itest/host-docker: files-only has the directory, with a file that arrives;
no-extra and files-only warn of nothing but store_dir_limit_size, defaults
of nothing more than the container's lack of systemd.

Tested on macOS (arm64), docker backend:
- itest/host-docker/run.sh with this tarball: 0 failed
- ./test.sh checks with AI_AGENT and CLAUDECODE unset: passed up to
  vendor.sh check (needs GNU sed)
- ./test.sh itest: all 200 assertions passed; the host phase SKIPped (no
  /dev/kvm): its assertion on file units matches unattended-upgrades/ by
  LIKE and is unchanged by this

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Yolean gle-qa and others added 3 commits November 8, 2026 07:27
ubuntu-latest moved to the ubuntu-26.04 runner image (20261101), which
keeps fs.inotify.max_user_instances at the kernel's default of 128.
y-cluster v0.5.0's docker backend refuses to provision below 256, so
the test job failed before the cluster existed. The 24.04 image that
passed on 2026-10-26 had a higher value; the host-docker jobs pin
ubuntu-24.04 and were not affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A CI run failed at the kubectl-at assertions when GitHub answered 504 for
the envtest release asset, which downloaded fine minutes later. Both
downloads (the acceptance test's release and the itest cluster's) now go
through setup_envtest, which makes up to three attempts, 15 s and 30 s
apart, before test.sh fails as it did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On CI, y-cluster v0.5.0 provisions its default k3s, v1.35.6, where
y-cluster v0.7.2 defaults to v1.37.0. There, the 1.37 kubectl warned that
the server was outside its version skew, and apiserver-at, which runs the
cluster's own release, had setup-envtest download a second release, 1.35:
the download that failed with a 504. Both cluster configs now pin
v1.37.0+k3s1, so the cluster has the minor of ENVTEST_K8S whichever
y-cluster provisions it, and apiserver-at uses the release the acceptance
test has downloaded already.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@solsson
solsson merged commit e81e1ea into main Nov 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant