Supervisor: keep the Collector's error with a FAILED config; read system logs; clearer status and uninstall
Fixes from the 2026-10-28 Fleet e2e rerun on Supervisor 0.7.0, run in fresh macOS 15 and Ubuntu 24.04 VMs.
What changes
A FAILED config says why (e2e findings 2, 23). A bad remote config (an OTLP receiver on port 99999) rolled back as designed. But nothing on the host or the server kept the Collector's error: supervisor.log had no error, agent.log was rewritten by the restored config's start, and the status said only "Config apply timeout exceeded The last working remote config runs in its place."
- The installers now set upstream's
agent.collector_crash_log_snippet_kib: 4. reportApply(already fork code) adds the Collector's log tail to every FAILED status, not only to an exit during the apply. That covers a timeout too, which is what macOS reported for the same crash.- The tail is read before the restore. The tail and
opampsupervisor statusnow show the error on the host, throughsupervisor-status.json. - The rollback sentence stays last, on a line of its own after the tail: Platform's
Diagnostic::reportedrecognizesrolled_backbyends_with("The last working remote config runs in its place."). - A period is added only when something follows the first message, so no other status text changes.
- Result:
Config apply timeout exceeded.\nCollector log tail:\n…\nThe last working remote config runs in its place.
Linux hosts can read system logs (e2e finding 22, Bill's call). On Ubuntu, /var/log/syslog, auth.log and kern.log are syslog:adm 0640. The Collector runs as pydantic-opamp, so it read none of them while Fleet showed Healthy.
postinstall.shnow adds the user toadmandsystemd-journalwhere those groups exist, once per host.- A marker,
/etc/pydantic-opamp/log-groups, keeps an operator's latergpasswd -dacross upgrades. - The README documents how to opt out, and that RHEL's
/var/log/messagesis root-only.
opampsupervisor status, as the installers print it (finding 14). It printed Collector unhealthy since … (0s ago): with an empty reason. Before the first remote config it now says the Collector is waiting for it; otherwise it prints "unhealthy since …" without the dangling colon.
pydantic-opamp-uninstall (findings 16, 21).
- The default run printed only pkgutil's or dpkg's line. It now says what it removed and kept, and how to purge.
- It says the server still lists the host until its credentials are revoked.
- A macOS purge removes the empty
/opt/pydantic-opamp/shareand/opt/pydantic-opamp.
OpAMP spec vs our choices
- Spec:
RemoteConfigStatus.error_messageis the field for "why FAILED". It now carries the log tail. - Our choices, where the spec is open: the 4 KiB size, adding the tail to every FAILED status, keeping the rollback sentence last, and the group memberships (packaging only, outside OpAMP).
Tests
go test ./supervisor/passes, exceptTest_NewSupervisorFailedStorageCreation, which fails only because the sandbox runs as root and fails on main too.- New tests:
TestARollbackStatusCarriesTheLogTailFirst, which runs the agent loop and checks the exact rollback message.TestSupervisor_reportApply/failed carries the log tail.TestAnUnhealthyCollectorWithoutAReason.
TestARollbackReportsOnlyTheFailedConfignow checks for the separate sentence.go test ./packaging/passes. The uninstall test checks the summary and the macOS directory cleanup.postinstall.shis covered by the root-only install test (-tags=install);sh -npasses here.
These reach hosts in the next Supervisor release, then the logfire-cli pin. Platform keeps storing only the diagnostic code by design. The Platform PR points users to opampsupervisor status for the Collector's error.
🤖 Generated with Claude Code