Repository navigation
feat(ns-api): add temperatures to metrics-history - #2027
Draft
filippocarletti wants to merge 1 commit into
Draft
filippocarletti wants to merge 1 commit into
filippocarletti wants to merge 1 commit into
Conversation
Return hardware temperatures collected by the Telegraf sensors input, grouped by chip, so the UI can chart them on the Metrics page. Each chip carries the lowest high (max) and critical thresholds, to show how far the temperature is from the limit. Readings and thresholds outside 0-150 °C are dropped, as some chips report bogus values for unconnected inputs or unset limits. Assisted-by: Claude Code:Opus 5.5
This was referenced Nov 19, 2026
This branch has not been deployed
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.
Telegraf already collects hardware temperatures, but the Metrics page does not show them. I add them to the metrics history API, so the UI can chart them and show how far each sensor is from its limit.
The
ns.telegraf metrics-historycall returns a newtemperaturefield. Nothing else in the response changes. When the hardware has no sensors, the field is empty.core_2comes beforecore_10.How to test
api-cli ns.telegraf metrics-history --data '{"start": <now-1800>, "end": <now>, "step": 30}'.temperaturelists the chips found bysensors, with values in °C and the High and Critical thresholds.temperatureis{}.I tested it on a physical firewall with one AMD sensor chip, and on a VM without sensors. I did not test hardware with many chips or many CPU cores, or chips that report fake values. I checked those cases only with made-up data.
See also