fix(telemetry): send the release version so GA4 can report it - #3270
Merged
vpetersson merged 1 commit intoAug 7, 2026
Conversation
The GA4 "Version distribution" report reads a `version_name` dimension that nothing has ever sent — not this payload, and not the pre-Screenly#2798 one either, whose `Pi_Version` was the *hardware* model. So the report showed ~3,700 devices as "(not reported)" and could never have worked. - add `version_name` from get_anthias_release() (pyproject.toml, which ships in the image) rather than an env var, since missing env vars are the known failure mode for telemetry params. Verified inside anthias-anthias-celery-1 on the pi5 testbed: resolves to '2026.7.3' with no extra plumbing - fall back to 'unknown' rather than '', so a device whose version lookup fails gets its own bucket instead of silently rejoining the "(not reported)" pile that hid this - correct the docstring: the event was renamed `version` -> `device_active` in Screenly#2798 and the docstring still said `version`
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3270 +/- ##
=========================================
Coverage ? 90.71%
=========================================
Files ? 76
Lines ? 8440
Branches ? 896
=========================================
Hits ? 7656
Misses ? 563
Partials ? 221 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5 tasks
vpetersson
approved these changes
Aug 7, 2026
5 tasks
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.



Issues Fixed
No associated issue — reported directly from the GA4 dashboard, where the "Version distribution" report shows ~3,700 of ~3,700 active devices as "(not reported)".
Description
The report reads a
version_namedimension that nothing has ever sent.The current telemetry payload carries
branch,commit_short,device_type,hardware_model,is_balena,resolution,audio_output,tls_enabledand asset counts — no version field of any kind. I checked the pre-#2798 payload too in case this was a regression: that one hadPi_Version, but it isparse_cpu_info()['model'], i.e. the hardware model, not the software release. Nothing in the tree sendsversion_name,app_versionorappVersion.So this is not a delivery problem or a sampling artefact — GA has nothing to populate the dimension with, and the report could not have worked at any point.
The change
Adds
version_nameto thedevice_activeparams, fromget_anthias_release().Sourced from
get_anthias_release()rather than an env var deliberately: missing env vars are the known failure mode for these params (the same class of bug asdevice_typereportingunknown).get_anthias_release()readspyproject.toml's[project].version, which ships inside the image, so it needs no compose or env plumbing. Verified inside the actual celery container on the Pi 5 testbed before relying on it:Falls back to
'unknown'rather than''so a device whose version lookup fails gets its own visible bucket, instead of silently rejoining the "(not reported)" pile that hid this in the first place.Resulting payload:
Also corrects the
send_telemetrydocstring, which still said it emits aversionevent; that was renamed todevice_activein #2798.Note on the two devices that DO report a version
The dashboard shows 2 devices on
2026.05.7and 1 (previous period) on2026.05.4. Since nothing in-tree has ever sent a version param, I cannot account for those from this source — most likely a patched or forked build. Flagging it rather than guessing; they should be easy to distinguish once real data starts flowing.Rollout
Telemetry is rate-limited to one event per device per 24h via a Redis cooldown, so the report should populate within a day of devices picking this up.
Checklist
Device boxes unticked: no device behaviour changes, only an extra field in an outbound analytics payload. The one device-dependent assumption — that the version resolves inside the celery container without env plumbing — was verified on the Pi 5 testbed, as quoted above.