Rollout: Telegraf gatherers on PVE hosts and guests (drafted 2026-11-24)
Goal: every PVE host and guest runs Telegraf and writes to the central relay on werner, which already fans out to VictoriaMetrics, TimescaleDB and GreptimeDB. PVE hosts additionally run fleet-joules (FleetObs) under inputs.execd. The PVE Metric Server push stays as it is.
Config templates: config/gatherer/. Nothing here has been applied to a host yet. Items marked [check] are not verified.
0. Decisions needed before the first host
| # | Decision | Recommendation |
|---|---|---|
| 1 | Listener token | SW-CRED-01 in docs/secrets.md; recycling tracked in SterreWag#1. Recycle before it goes on the fleet. The PVE Metric Server entries (/etc/pve/status.cfg, one per cluster) use the same token. |
| 2 | One shared token or separate listeners | influxdb_v2_listener takes one token. For per-source revocation, add a second listener on another port for gatherers. Start with one. |
| 3 | Buckets (btag) | By data class, not by host: see "Buckets" below. Names proposed, not yet agreed. |
| 4 | Transport security | The listener is plain HTTP. Acceptable on the management network for a pilot; add TLS on the listener before guests on tenant networks write to it. |
| 5 | Telegraf version | Decided 2026-11-24: latest stable from the InfluxData Debian repo through apt-cacher-ng, on the relay and on every gatherer, upgraded frequently. No version pin or hold. See section 3. |
| 6 | Pilot hosts | Decided 2026-11-24: templeton (charlottesweb), werner (standalone; also hosts the relay), and qe2: arctic, atlantic, pacific, indian (Ceph, no ZFS pools expected). |
| 7 | Deployment tool | A telegraf_gatherer role in ansible-ops (run from Semaphore), with the pilot host done by hand first to settle the config. |
Questions from Hardy's side (asked on Zulip, AI › Telemtry-AI-energy, 2026-11-27)
| # | Question | From | Notes |
|---|---|---|---|
| 8 | May hr, hr2 and rc write host basics (CPU, memory, disk, network) to the relay every 10 s? | Johlan (4951358) | Decided 2026-12-01: yes, 10 s is fine. They are guests on our PVE hosts, run by Hardy's side. They hold until the new token exists. Answered on Zulip 2026-12-01 (4951768). |
| 9 | What limit should the trial stay under, as samples or disk per day? Their estimate: ~40 values/s, ~3.3M samples/day. They report real TSDB numbers after week one. | Johlan (4951358) | Decided 2026-12-01: their estimate is fine in principle; no number is set until the pilot hosts have been measured. Answered on Zulip 2026-12-01 (4951768). |
| 10 | On hr, hr2 and rc: use our install.sh with --role guest, or their own Telegraf install writing to bucket guest? | Shannon, Johlan's Claude (4951366) | Decided 2026-12-01: their own script is fine, and they share it with us so we know what to expect. They do not write to guest: internal guests push to their own tenant bucket, see "Tenant buckets" below. Answered on Zulip 2026-12-01 (4951768). |
| 11 | Will the Telegraf on atlantic, indian and arctic read whole-server power from the management card, for example ipmi_sensor (DCMI) every 60 s? Their fallback is LibreNMS's InfluxDB export through the relay, which sends every device's data. | Shannon (4951370) | Open, waiting on Hendrik (told them "noted, not decided", 4951768). Needs ipmitool and /dev/ipmi0 access for the telegraf user on those hosts, and [check] that their BMCs answer DCMI power reading. Would go to bucket energy as a sensors-style drop-in. Fits phase 4 at the earliest. |
Follow-on from 8 and 10 for decision 2: hr, hr2 and rc are writers outside our administration. Recommendation: give Hardy's side its own listener (second influxdb_v2_listener, own port and token, SW-CRED-06) so their token can be revoked or recycled without touching the PVE hosts.
Buckets
The bucket says what kind of data it is, because that is what sets retention, resolution and who reads it. Which host, cluster or guest is a tag, never a bucket. That holds for the infrastructure buckets below; tenant guests are the exception ("Tenant buckets").
Bucket (btag) | Contents | Source | Rate | Retention idea |
|---|---|---|---|---|
energy | fleet_* from fleet-joules: RAPL joules, per-guest and host CPU time | execd input on PVE hosts | ~1 s | 180 d raw (the Zulip estimate), then downsample |
pve-host | OS view of the hypervisor: cpu, mem, disk, diskio, net, zfs, sensors | Telegraf on PVE hosts | 10–60 s | medium |
guest | OS view from inside a VM/CT | Telegraf in guests | 10–60 s | medium |
| *(existing)* | PVE Metric Server push: PVE's own view of nodes, guests and storage | PVE | 10 s | unchanged; [check] its bucket name on the relay |
Tags that select within a bucket: host (node or guest name), cluster, and for energy the guest tag fleet-joules emits. "Energy for templeton" is bucket energy, host="templeton"; "all of qe2" is cluster="qe2".
How it is routed: the gatherer has one output with bucket_tag = "btag". global_tags sets the machine's default (SW_BUCKET = pve-host or guest), and an input overrides it with [inputs.X.tags] btag = "energy". The relay's listener and outputs already use btag, so no relay change is needed for routing.
Per TSDB: VictoriaMetrics turns the bucket into a db label; GreptimeDB uses it as the database name, which [check] may have to be created first; TimescaleDB ignores it (one database), so only the btag column differs.
Tenant buckets (Hendrik, 2026-12-01)
Guests that belong to a tenant push to their own bucket, not to the shared guest bucket.
- Full form:
${TENANT}-${CLIENT}-${PROJECT}-${HOST}. - Minimum:
${TENANT}-${CLIENT/PROJECT}. - Hardy's side:
TENANT=AGW, internalCLIENT=AGW,PROJECT=CAPABLE. The project name is Hendrik's assumption and is not confirmed by them. That givesAGW-AGW-CAPABLE-hrin full, orAGW-CAPABLEat the minimum. - The shared
guestbucket stays for guests we run ourselves.
Open points:
- [check] Separator and case. GreptimeDB uses the bucket as a database name, and a
-or upper case in it may need quoting or be refused. The database may also have to exist before the first write. - A bucket per host multiplies GreptimeDB databases and VictoriaMetrics
dblabel values. Not decided whether Hardy's guests use the full form or the minimum. - One listener token lets a writer name any bucket. Keeping a tenant inside its own prefix needs the separate listener (
SW-CRED-06) plus atagpass/processor check onbtagat the relay. Not decided. - Their own install has to set
btag(or thebucketof its output) to the tenant bucket and keephostequal to the guest's PVE name, so guest-side and PVE-side series still join.
1. Central relay preparation (werner, Hendrik)
- Re-snapshot the live config into
config/central/telegraf.confbefore changing it. - Rotate the listener token (decision 1). Move the token and the TimescaleDB DSN out of the file into
/etc/default/telegraf. - Set
debug = false; at fleet volume debug logging is large. - Raise
metric_buffer_limit(50000 per output today) to cover a TSDB outage at the new rate, or accept the loss. Rough rate: 19 hosts × ~18 metrics/s plus guests. [check] with the pilot host's real numbers. - Measurement-name collisions [check]: the PVE push already writes measurements such as
system, and Telegraf'sinputs.system,cpu,memandnetuse overlapping names with different tags and fields.- VictoriaMetrics and GreptimeDB separate them by bucket (
btag), so a distinct bucket is enough. - TimescaleDB has one database and one table per measurement.
outputs.postgresqlwill add columns to the existing tables, and a field with the same name but another type will be rejected. Check thesystem,cpuandmemtables against the pilot's output before the fleet goes on. If they clash, give the PostgreSQL output atagpass/namepasssplit or rename gatherer measurements with a processor on the relay.
- VictoriaMetrics and GreptimeDB separate them by bucket (
- The existing
processors.regexonnet(tap →vmid) also applies to gatherernetmetrics. The gatherer template excludes tap interfaces, so nothing changes. - Firewall: allow TCP 7369 to
2c0f:fc78:feef:e000:1:2:3:13from every cluster's management prefix, and from guest networks once guests are added. - DNS: DNS-Stuff#13. Gatherers use the address literal until
telegraf.error.net.zais clean.
2. Per-host preflight (read-only)
Run on each PVE host before installing:
pveversion # PVE 8 (bookworm) or 9 (trixie)
hostname; cat /etc/hostname # must equal the PVE node name
curl -6 -sS -o /dev/null -w '%{http_code}\n' 'http://[2c0f:fc78:feef:e000:1:2:3:13]:7369/health' # expect 200
ls -l /sys/class/powercap/intel-rapl:*/energy_uj # RAPL present? (AMD needs the intel_rapl_msr module)
cat /sys/class/powercap/intel-rapl:*/name /sys/class/powercap/intel-rapl:*/max_energy_range_uj
stat -fc %T /sys/fs/cgroup # cgroup2fs expected
ls /sys/fs/cgroup/qemu.slice /sys/fs/cgroup/lxc 2>/dev/null | head # guest cgroup layout fleet-joules walks
ls /dev/ipmi0 2>/dev/null; command -v ipmitool sensors
systemctl is-active telegraf 2>/dev/null # is something already there?Record the results per host: RAPL zones (sockets), PPT if above 400 W (--max-watts), cgroup layout, IPMI. A host with no RAPL zones gets Telegraf without fleet-joules.
2a. Install script
config/gatherer/install.sh does sections 3, 4 and 5 in one run: apt key and source, latest Telegraf, the initial configs, /etc/default/telegraf, optionally fleet-joules, a telegraf --test, then enable and start. The sections below describe what it does and are the manual fallback.
# on the workstation: bundle the gatherer directory (and, for PVE hosts, the fork's deploy/ directory)
tar -C config -czf gatherer.tgz gatherer
tar -C ../fleetobs -czf fleetobs-deploy.tgz deploy # checkout on branch ecs/execd
scp gatherer.tgz fleetobs-deploy.tgz [email protected]:/root/
# on the host, as root; the token file comes from the secrets custodian, not from this repo
tar xzf gatherer.tgz && tar xzf fleetobs-deploy.tgz
./gatherer/install.sh --dry-run --role pve-host --cluster charlottesweb --token-file /root/relay.token
./gatherer/install.sh --role pve-host --cluster charlottesweb --token-file /root/relay.token \
--fleet-joules ./deploy --fleet-joules-bin <URL on apter> --fleet-joules-sha256 <sha256>
shred -u /root/relay.token- Pilot values: templeton
--cluster charlottesweb; werner--cluster standalone; arctic, atlantic, pacific, indian--cluster qe2. Guests:--role guest, no fleet-joules options. - Without
--fleet-joulesit installs Telegraf only; fleet-joules can be added by re-running later. The binary does not exist as a published artifact yet (section 4, step 1). - Drop-ins are chosen per machine:
kernel.conf(kernel, diskio) not in LXC containers,zfs.confonly where ZFS is loaded,sensors.confonly with lm-sensors. Installed files are namedsw-*.conf. - It refuses to install the fleet-joules drop-in if
energy_ujis not0440 root:fleet-joulesafter the grant. - Without a token it installs everything and leaves Telegraf stopped.
- Re-running is safe. A pre-existing
telegraf.confis saved once astelegraf.conf.pre-sterrewag. - Status: syntax-checked and dry-run on the workstation only. Never run on a host. Use
--dry-runfirst.
3. Install Telegraf on a PVE host
- Package: current stable from the InfluxData Debian repo, fetched through apt-cacher-ng on apter (hosts need no direct internet). Files are in
config/gatherer/apt/:install -m 0644 influxdata-archive.asc /etc/apt/keyrings/influxdata-archive.asc install -m 0644 influxdata.sources /etc/apt/sources.list.d/influxdata.sources apt-config dump | grep -i 'Acquire::http::Proxy' # must show apter:3142 (base role); the source is plain http:// apt update && apt-cache policy telegraf # candidate = newest in the repo (1.40.4-1 on 2026-11-24) apt install telegraf systemctl stop telegraf # the package starts it with the stock config
- Verified from Hclaude01 on 2026-11-24:
http://repos.influxdata.com/debiananswers through the cache atapter:3142, newest is1.40.4-1, andInReleaseverifies with the committed key. Not yet run on a PVE host. - Key: primary
24C975CBA61A024EE1B631787C3D57159FC2F927, signing subkeyAC10D744…0585BD3B(expires 2029-01-17), sha256 of the file40557e26…904d5dac. The copy on apter (/files/keys/influxdata-archive.key, and inKeyRing.asc) is stale: it only has the subkey that expired 2026-01-17, so it cannot verify this repo. Refresh tracked in apter-keys-dls#1. - The cache refuses non-repository paths (403 for the key URL), so the key is shipped from this repo.
- No pin: hosts follow the repo's latest, as the relay does. An upgrade restarts Telegraf; with the memory buffer that loses only what was unsent at that moment. Read the release notes on a new minor for removed options.
- Verified from Hclaude01 on 2026-11-24:
- Config:
config/gatherer/telegraf.conf→/etc/telegraf/telegraf.conf, the drop-ins intelegraf.d/→/etc/telegraf/telegraf.d/:base.confandkernel.confalways,zfs.confonly with ZFS (not the qe2 Ceph hosts),sensors.confonly withlm-sensors. - Environment:
/etc/default/telegraf,root:telegraf 0640, holdingINFLUX_LISTENER_TOKEN,SW_BUCKET=pve-hostandSW_CLUSTER=<cluster>. The token is delivered by the secrets custodian, never through Zulip or git. - Dry run, then start:
set -a; . /etc/default/telegraf; set +a sudo -u telegraf --preserve-env=INFLUX_LISTENER_TOKEN,SW_BUCKET,SW_CLUSTER \ telegraf --config /etc/telegraf/telegraf.conf --config-directory /etc/telegraf/telegraf.d --test | head -40 systemctl enable --now telegraf journalctl -u telegraf -n 30 --no-pager
- Verify on VictoriaMetrics that the host's series arrive (
db="pve-host",host="<node>"), and on the relay that there are no write errors for TimescaleDB.
4. FleetObs fleet-joules on a PVE host
Source: our fork hclaude/fleetobs, branch ecs/execd, version 1.2.0 (../fleetobs). Upstream OntologyLabs/fleetobs has only the inputs.exec and file modes; see docs/fleetobs.md.
What the branch provides (mode C in its deploy/README.md, the recommended one):
fleet-joules --stream --interval 1 --no-hostruns as one long-lived child of Telegraf underinputs.execd,signal = "none".--stdinis thesignal = "STDIN"variant.--no-hostleaves thehosttag to Telegraf.- Telegraf stays non-root: group
fleet-joulesgets read onenergy_ujthrough systemd-tmpfiles, and the Telegraf unit getsSupplementaryGroups=fleet-joulesplus anExecStartPrethat re-applies the grant on every start. - Mode D, for hosts where that is not wanted: a root unit pushing
unixgramdatagrams toinputs.socket_listener.
Status of the branch (2026-11-24): 191 tests pass; execd (both signals) and the socket mode were run under a real Telegraf 1.36.4 against fixture directories. Not yet run under systemd or on a PVE host: the sysusers, tmpfiles, udev and unit files are unexercised, so the first pilot host is their test. Not yet run under Telegraf 1.40.
Steps (files are under deploy/ in the fork):
- Binary: where it is built is not decided. It must not come from a workstation build. Proposal: a Forgejo runner builds the fork's tagged source as a static musl binary (bookworm and trixie) and publishes it on the apter mirror with a
.sourcemarker and sha256; tracked in apter-keys-dls#2. Install as/usr/local/bin/fleet-joules(root:root 0755). Until then, Telegraf goes on without fleet-joules. - Group and grant:
install -m 0644 sysusers.d/fleet-joules.conf /etc/sysusers.d/ && systemd-sysusers fleet-joules.conf install -m 0644 tmpfiles.d/fleet-joules.conf /etc/tmpfiles.d/ && systemd-tmpfiles --create fleet-joules.conf ls -l /sys/devices/virtual/powercap/intel-rapl/intel-rapl:*/energy_uj # expect -r--r----- root fleet-joules ls -ld /run/fleet-joules-state # expect drwx------ telegraf telegraf
This is the first real test of
zon a sysfs attribute. If the mode or group did not change, stop and use mode D. - Telegraf unit drop-in:
install -D -m 0644 systemd/telegraf.service.d/fleet-joules.conf /etc/systemd/system/telegraf.service.d/fleet-joules.conf, thensystemctl daemon-reload. - Optional:
udev/70-fleet-joules.rules→/etc/udev/rules.d/. It re-applies the grant if the RAPL module is reloaded while Telegraf runs; without it energy shows asfleet_energy_unmeasureduntil Telegraf restarts. telegraf.d/fleet-execd.conf→/etc/telegraf/telegraf.d/. Two local edits:- Append to the
[[inputs.execd]]block, as its last lines, the bucket override:[inputs.execd.tags] btag = "energy" - Add
"--max-watts", "<W>"tocommandif the preflight shows a socket PPT above 400 W.
- Append to the
- Check by hand as Telegraf would run it, then restart:
sudo -u telegraf -g fleet-joules /usr/local/bin/fleet-joules --once --no-host | head systemctl restart telegraf; journalctl -u telegraf -n 30 --no-pager
Also confirm the telegraf user can read the guest
cpu.statfiles (fleet_guest_cpulines present, nofleet_guest_cpu_unmeasured); that was not verifiable off-host. - Verify on the TSDBs:
fleet_energy,fleet_guest_cpuandfleet_host_cpuarrive every second in bucketenergy,total_ujonly rises, and there are nofleet_energy_discontinuityorfleet_energy_unmeasuredpoints in steady state. Reboot the pilot host once: the grant must come back, and the total restarts with afleet_energy_state_resetline.
Install exactly one of fleet-execd.conf, fleet-socket.conf, fleet-exec.conf, fleet-file.conf: they share one state lock, and a second instance exits 4.
IPMI power (fleet-ipmi.conf) stays out until ipmitool dcmi power reading answers on that host.
5. Install Telegraf in guests
- Tenant guests (hr, hr2, rc): installed by the tenant with their own script, into their tenant bucket ("Tenant buckets"). The rest of this section is for guests we run.
- Same package,
telegraf.confandtelegraf.d/base.conf;SW_BUCKET=guest,SW_CLUSTER= the cluster it runs on at install time (it does not follow a migration; drop the tag if that is misleading). hostnamemust match the guest's name in PVE so guest-side and PVE-side series join.- LXC:
cpu,memanddiskshow the container's view through lxcfs.diskioandkernelshow the host's, sokernel.confis left out in containers. - Non-systemd guests (Devuan): the deb ships an init script;
/etc/default/telegrafis read the same way. [check] - Guests that cannot reach werner's address on 7369 need a firewall rule or a route first (section 1.7).
- Order: guests on the pilot host first, then by cluster. Guest inventory is not in this repo yet; take it from the PVE API (
noc_audit@pve).
6. Order of work (Hendrik, 2026-12-01)
Each phase has to work before the next one starts.
| Phase | What | Done when | Sections |
|---|---|---|---|
| 1 | Finish and audit the central relay on werner | Config re-snapshotted, token recycled (SW-CRED-01), debug off, buffer and firewall settled | 1 |
| 2 | Plain Telegraf (no fleet-joules) on the PVE hosts we know, pilot hosts first, templeton first | pve-host data from each host arrives at the relay without errors | 2, 2a, 3 |
| 3 | Set up and verify the TSDB side, VictoriaMetrics first | Phase 2 data is queryable per host and cluster; load numbers recorded (below) | tsdb.md |
| 4 | Test the fleet-joules reader on templeton | fleet_* in bucket energy every second; 24 h soak; cost on the TSDBs known | 4 |
| 5 | Johlan and Hardy point their guest Telegrafs (hr, hr2, rc) at the relay; check the feeds in the TSDBs | Their tenant bucket shows data; their shared script reviewed | 5, "Tenant buckets" |
After phase 5: the telegraf_gatherer Ansible role, remaining hosts (Charlotte's Web, duckpond, qq, standalones), our own guests, and the PR to OntologyLabs/fleetobs when Hendrik asks for it.
Until phase 5, Hardy's side keeps holding its writes. Question 9 (the limit) is answered from the phase 3 and 4 numbers.
What Hardy and Johlan expect from the TSDB side (from the Zulip topic)
- VictoriaMetrics is the store they plan to query. Hardy (4949603) suggested it as the target because it takes line protocol unchanged; Johlan (4950114) plans to match metrics in VictoriaMetrics against job run times.
- End goal (Hardy, 4949603): power, CPU, RAM, tokens and queue time per build job in one store.
- They offered to report after week one: active series, samples/s, disk bytes per sample, CPU and RAM of the instance. Those are the numbers phase 3 should be able to produce.
- Trial scope they named: host basics on hr, hr2 and rc at 10 s, plus fleet-joules on one host at 5 s; raw ingest only, no aggregation. Estimate ~40 values/s, ~3.3M samples/day, 180 days, 1–5 GB.
- Access:
claudinaper-source users, write-only where the database allows, on the relay, VictoriaMetrics, TimescaleDB and GreptimeDB. Ryan reported all three TSDBs "updated" (4949517, 2026-11-10). [check] whether the users exist and whether read access for their queries was ever set up; nobody has asked for it explicitly. - Whole-server power next to CPU energy (question 11).
- TimescaleDB and GreptimeDB: no stated expectation from their side. They are our own comparison targets.