How to collect telemetry with a sink¶
The sink collects every runner's logs, job output and metrics on an
always-on machine: a runner or any other Linux host. It needs no root once
it is set up. These steps assume /usr/local/bin/allmyram is already on that
machine. What the sink sees
explains what it collects and why.
Add the sink¶
-
On the sink machine, create its user and directory. The last line lets you read the telemetry; log in again afterwards.
-
On the laptop, start the invite. It waits for the sink, which has 15 minutes to join.
-
On the sink machine, join and paste the invite on stdin.
NAMEis a DNS label, different from every runner's name. The unit passes the hostname (--name %H), so ifNAMEis anything else, edit the unit too.joincreates the state directory. -
Compare the fingerprint with the laptop's and approve there. Touch ID asks once, to sign the record naming the sink, which the laptop sends to every runner. The laptop prints
sink NAME joined, thenreached:and the runners that took the record; a runner it couldn't reach is reported on stderr. It then waits up to 2 minutes for the sink's service to take the runner list, so go straight on to the next step. -
Install and start the unit from
deploy/linux/: -
If the invite gave up waiting for the service and warned, run
allmyram sync-sinkon the laptop to send the runner list.
Telemetry lands in /var/lib/allmyram-sink/data as hourly logs-*.jsonl
and metrics-*.jsonl files. The unit keeps 30 days and at most 10 GiB.
Read the telemetry¶
On the sink, as a member of the allmyram-sink group, with the DuckDB CLI
and deploy/linux/sink.sql:
from runners;shows each runner's last heartbeat.from jobs(24);shows the jobs that ended in the last 24 hours, by outcome.from usage(24);shows how much idle memory and CPU jobs used.
The other views are run_ends, job_output, runner_logs and
metric_points. The file's header has more examples.
Keep the sink's certificate current¶
The host certificate lasts 30 days and renews when the laptop connects to
the sink with under 10 days left: on a runner join or removal, revoke,
rotate-client-key and sync-sink. If none of those happened for a while,
run allmyram sync-sink. After it has expired, run allmyram renew NAME.
Retire or move the sink¶
- On the laptop:
allmyram remove NAME. Touch ID signs a record saying there is no sink, and every runner stops keeping telemetry. - On the old sink:
sudo systemctl disable --now allmyram-sink. A sink left running keeps dialing runners, which turn it away; its log warns once per runner that the runner's sink record does not name it. - To move it, add the sink again on the new machine.