Skip to content

feat(host_metrics source): add temperature metrics collector#25607

Open
somaz94 wants to merge 4 commits into
vectordotdev:masterfrom
somaz94:feat/host-metrics-temperature
Open

feat(host_metrics source): add temperature metrics collector#25607
somaz94 wants to merge 4 commits into
vectordotdev:masterfrom
somaz94:feat/host-metrics-temperature

Conversation

@somaz94

@somaz94 somaz94 commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Adds a temperature collector to the host_metrics source. When enabled, it reads hardware temperature sensors via sysinfo::Components and emits three gauges, each tagged with the component label of the sensor it was read from:

  • temperature_celsius — current temperature
  • temperature_max_celsius — highest recorded temperature
  • temperature_critical_celsius — critical threshold (only when the sensor reports one)

The collector is opt-in (it is not part of the default collector set). Many environments where Vector runs — containers, virtual machines, most cloud instances — expose no temperature sensors, so enabling it by default would add a per-scrape Components refresh that yields nothing. Users add temperature to collectors to turn it on. Components that do not report a given value are skipped, and hosts without sensors simply produce no metrics.

Closes: #21389

Vector configuration

sources:
  host:
    type: host_metrics
    collectors:
      - temperature

How did you test this PR?

  • Added a generates_temperature_metrics unit test that asserts every emitted metric is a gauge named temperature* and carries the component tag. The test tolerates an empty result so it also passes in sensorless CI environments.
  • Updated the hand-written metric documentation and regenerated the component config docs (generated/host_metrics.cue) for the new temperature collector enum value.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Added a changelog fragment under changelog.d/.
  • No. A maintainer will apply the no-changelog label to this PR.

References

@github-actions github-actions Bot added domain: sources Anything related to the Vector's sources domain: external docs Anything related to Vector's external, public documentation labels Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Jun 11, 2026
@somaz94

somaz94 commented Jun 11, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@somaz94 somaz94 marked this pull request as ready for review June 12, 2026 01:14
@somaz94 somaz94 requested review from a team as code owners June 12, 2026 01:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34f8b6fec3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sources/host_metrics/temperature.rs Outdated
Comment thread src/sources/host_metrics/temperature.rs Outdated
Comment thread src/sources/host_metrics/temperature.rs Outdated
Comment thread src/sources/host_metrics/temperature.rs Outdated
@somaz94 somaz94 force-pushed the feat/host-metrics-temperature branch from 34f8b6f to 4c51702 Compare June 12, 2026 05:52
@evazorro evazorro self-assigned this Jun 12, 2026
@somaz94

somaz94 commented Jun 19, 2026

Copy link
Copy Markdown
Author

Thanks for the approval @evazorro! CLA is signed and CI is green. It looks like this still needs a second review to land. Anything I can do to help move it along?

@evazorro

Copy link
Copy Markdown
Contributor

Hi @somaz94, I checked in with the dev team and they can review it after you've resolved the comments from the AI review tool. More information here: https://github.com/vectordotdev/vector/blob/master/AI_POLICY.md#ai-review-comments

Thanks for contributing!

@evazorro evazorro removed their assignment Jun 25, 2026
@pront pront enabled auto-merge June 25, 2026 14:53
@github-actions github-actions Bot removed the docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. label Jun 25, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 438cb1c41f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sources/host_metrics/temperature.rs Outdated
auto-merge was automatically disabled June 26, 2026 02:19

Head branch was pushed to by a user without write access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: external docs Anything related to Vector's external, public documentation domain: sources Anything related to the Vector's sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

could you pls add sensors info in host_metrics

3 participants