1
0
Fork 0
mirror of https://github.com/imjasonh/esp32 synced 2026-07-18 14:35:08 +00:00

provision OTA repo/tag/poll_secs; tag logs+metrics with fw_version

Two related additions for fleet observability + tunability:

1. `[ota]` block in provisioning.toml. Optional, individually-optional
   fields: `repo`, `tag`, `poll_secs`. Writes to the existing `ota` NVS
   namespace (key names match src/ota.rs's NVS_REPO / NVS_TAG /
   NVS_POLL_SECS). Missing keys leave the firmware on its compile-time
   defaults (ghcr.io/imjasonh/esp32:latest, 60 s poll).

2. `fw_version` (the GIT_SHA baked in at build time) on every log
   entry and every metric series, so behaviour can be correlated with
   a release across the fleet.
   - cloud_log: jsonPayload.fw_version on every entry.
   - metrics: metric.labels.fw_version on every TimeSeries (resource
     labels can't carry it — `generic_node` has a fixed schema; metric
     labels let queries split heap, rssi, etc. by fw).

Both threaded from main.rs's existing FW_VERSION constant; no new
config plumbing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Hall 2026-05-02 23:56:26 -04:00
parent e525bb2bbf
commit 01c8c2da75
5 changed files with 70 additions and 7 deletions

View file

@ -40,3 +40,12 @@ issuer = "https://token.actions.githubusercontent.com"
# sa_key_pem = "gcp-sa-key.pem" # path to the PKCS#8 RSA private key PEM
# min_severity = "info" # trace / debug / info / warn / error
# metrics_interval_secs = 300 # 0 = metrics off (logs still ship); default 300
# Optional. If absent, OTA loop uses compile-time defaults
# (ghcr.io/imjasonh/esp32:latest, 60 s poll). Each field is
# individually optional too — only present ones override.
#
# [ota]
# repo = "ghcr.io/imjasonh/esp32" # default
# tag = "latest" # default
# poll_secs = 600 # default 60; bump for steady-state fleets