server: optional log of served device config#154
Merged
milan-zededa merged 1 commit intoMay 15, 2026
Conversation
Adam logs every inbound API request, but not the response shape. When
debugging "what did adam tell EVE on this poll?" the request log
alone doesn't say whether adam returned a baseos to install, what
content-tree UUID, how many apps/networks/etc.
Add a one-line response summary at log.Printf level, gated by an
env var (ADAM_LOG_DEVICE_CONFIG=1) so the default log volume is
unchanged. Fires before the 304 Not Modified check so no-change
polls still surface what would have been returned.
Format:
config served: uuid=<UUID> version=<N> baseos.version=<V>
baseos.activate=<bool> baseos.ct=<UUID> baseosconfig_list=<n>
contentInfo=<n> apps=<n> networks=<n> volumes=<n>
datastores=<n>
README gets a short subsection in Options describing the variable
and an example docker invocation.
Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
milan-zededa
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adam logs every inbound API request (
requested /api/v2/edgedevice/id/<UUID>/config).For investigations where you also need to see what was returned —
which baseos, which content tree, how many apps/networks etc. — the
request log alone isn't enough.
This PR adds a one-line response summary, gated by an env var so the
default log volume is unchanged.
Behaviour
With
ADAM_LOG_DEVICE_CONFIG=1set, every served device config emitson stderr:
Off by default → no log-volume cost for normal operators.
The log fires before the
304 Not Modifiedshort-circuit so itsurfaces the response shape on every poll, even those where EVE
already has the current config. That makes it useful for "is EVE
even polling for /config right now?" questions, not just "what's in
the response?".
How to enable
docker logs eden_adam(or wherever stderr lands) then carries oneconfig served:line per/configpoll.Field choice
The fields cover the categories the response body decomposes into —
baseos block, baseos list (legacy), contentInfo, apps, networks,
volumes, datastores. Each is summarised by either a key fact
(baseos: version + activate + content-tree UUID) or a count (lists).
That keeps the line a single grep target while still answering the
common debugging questions:
baseos.versionbaseos.activatecontentInfo=Nversion=NTest
Unit tests (
go test ./...) pass.