Skip to content

update: add status metrics for update progress#285

Closed
rslater-cs wants to merge 9 commits into
migration-basefrom
update-status-metrics
Closed

update: add status metrics for update progress#285
rslater-cs wants to merge 9 commits into
migration-basefrom
update-status-metrics

Conversation

@rslater-cs

@rslater-cs rslater-cs commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Description

The update service did not output any metrics for updates to the cloud which is needed for mcu updates so we can track them during deployment.
I have added metrics lifescycle code for building a emitting metrics and added the nessarsary metric pipeline to the config file.

The update progress is currently published under <component>/lifecycle/<job_id>/component_update_lifecycle with the string value <state> where <state> can be started, staged, completed, failed or cancelled. The subtopic is <component>.lifecycle.<job_id>.<state> with string value <state>. The job id is normalised to replace - with _ to keep compatibility with grafana.

Manual test

  • 👍 yes
  • 🙅 no
  • kinda but I need help fully testing it as I have no clue how to update my MCU or trigger an update

Manual test description

I have ran devicecode to make sure no error arise

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 🙅 no documentation needed

@rslater-cs
rslater-cs marked this pull request as draft June 23, 2026 15:08
@rslater-cs
rslater-cs force-pushed the update-status-metrics branch from 089663e to 774c280 Compare July 9, 2026 14:52
- Added a "process" field to the component_update_lifecycle protocol in bigbox-v1-cm-2.json.
- Updated main.lua to include profiling options for services.
- Introduced new functions in metrics.lua for tracing component lifecycle metrics and logging HTTP payloads.
- Enhanced HTTP publishing logic to handle metric chunks and added detailed logging for each chunk.
- Improved component_watch.lua to trace component fact changes and report metrics.
- Updated lifecycle_metrics.lua to sanitize job IDs in namespaces and log publishing actions.
- Enhanced service.lua to trace component lifecycle metrics and handle job states more robustly.
- Added unit tests to validate lifecycle metrics and ensure proper namespace formatting.
@cpunt
cpunt deleted the branch migration-base July 23, 2026 10:30
@cpunt cpunt closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants