Skip to content

feat(ns-api): add temperatures to metrics-history - #2027

Draft
filippocarletti wants to merge 1 commit into
mainfrom
feat/metrics-temperature
Draft

filippocarletti wants to merge 1 commit into
mainfrom
feat/metrics-temperature

Conversation

@filippocarletti

@filippocarletti filippocarletti commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

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-history call returns a new temperature field. Nothing else in the response changes. When the hardware has no sensors, the field is empty.

  • I group the sensors by chip. Each chip has one line per sensor, plus its lowest high and critical thresholds.
  • I drop readings and thresholds outside 0-150 °C. Some chips report fake values for unconnected inputs or unset limits.
  • I sort sensors in natural order, so core_2 comes before core_10.
  • I updated the API README.

How to test

  • On a firewall with temperature sensors, run api-cli ns.telegraf metrics-history --data '{"start": <now-1800>, "end": <now>, "step": 30}'.
  • Check that temperature lists the chips found by sensors, with values in °C and the High and Critical thresholds.
  • On a machine without sensors, like a VM, check that temperature is {}.

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

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 branch has not been deployed

No deployments
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.

1 participant