feat: add Prometheus metrics exporter endpoint (GET /metrics)#34
Open
bolausson wants to merge 2 commits into21cncstudio:mainfrom
Open
feat: add Prometheus metrics exporter endpoint (GET /metrics)#34bolausson wants to merge 2 commits into21cncstudio:mainfrom
bolausson wants to merge 2 commits into21cncstudio:mainfrom
Conversation
Export ~60 metrics in Prometheus text exposition format including all sensor readings, derived values, DAC/fan state, network status, and ESP32 system diagnostics (heap, PSRAM, chip temperature, flash sizes, FreeRTOS task count). Invalid sensors are omitted rather than zeroed. Flash metrics are cached at init to avoid repeated SPI reads.
Owner
|
Thanks a lot for the contribution and for the detailed implementation. For now, I’m focusing on core firmware stability and release scope, so this is a bit early for the current roadmap. I’d like to revisit this in a future phase when we expand observability features. I reviewed the changes locally and the idea is great. It’s just a timing/prioritization decision for this release cycle. Thanks again for the effort and for putting this together. |
Author
|
That is fine. |
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
GET /metricsendpoint exporting ~60 metrics in Prometheus text exposition formatFiles Changed
src/web/PrometheusExporter.h,src/web/PrometheusExporter.cpp— exporter implementationtest/test_prometheus_exporter/test_prometheus_exporter.cpp— 10 native unit testsdocs/prometheus/README.md— full metric reference, scrape config examples, PromQL queriessrc/modules/NetworkManager.cpp— route registration and initplatformio.ini— added exporter to native test build filterREADME.md— added Prometheus section with quick-start configTesting
pio run -e project_aura)pio test -e native_test), including 10 new tests covering sensor metric serialization, invalid sensor omission, derived metric computation, pressure trend output, and Prometheus format correctness (HELP/TYPE/value ordering)/api/statehandler and should be validated withcurl http://aura.local/metricsandpromtool check metricsonce hardware is availableChecklist