Thanks to visit codestin.com
Credit goes to github.com

Skip to content

enhancement(host_metrics source): replace heim with sysinfo for load/host metrics#24819

Open
mushrowan wants to merge 1 commit intovectordotdev:masterfrom
mushrowan:feat/host-metrics-loadhost-sysinfo
Open

enhancement(host_metrics source): replace heim with sysinfo for load/host metrics#24819
mushrowan wants to merge 1 commit intovectordotdev:masterfrom
mushrowan:feat/host-metrics-loadhost-sysinfo

Conversation

@mushrowan
Copy link
Contributor

Summary

replace heim with sysinfo for load average, uptime, and boot time in the
host_metrics source. part of removing the unmaintained heim dependency (#23646)

  • heim::cpu::os::unix::loadavg() -> System::load_average()
  • heim::host::uptime() -> System::uptime()
  • heim::host::boot_time() -> System::boot_time()

all three sysinfo methods are static, sync, and infallible so the error handling
arms are removed

Vector configuration

[sources.host_metrics]
type = "host_metrics"
collectors = ["load", "host"]

How did you test this PR?

cargo test -p vector --no-default-features --features sources-host_metrics \
  -- sources::host_metrics::tests::generates_loadavg_metrics \
     sources::host_metrics::tests::generates_host_metrics

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. Please add a changelog fragment based on our
    guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

…t metrics

replace heim::cpu::os::unix::loadavg, heim::host::uptime, and
heim::host::boot_time with sysinfo::System static methods.
removes heim unit imports (ratio, second) from mod.rs
@mushrowan mushrowan requested a review from a team as a code owner March 1, 2026 12:18
@github-actions github-actions bot added domain: sources Anything related to the Vector's sources domain: ci Anything related to Vector's CI environment labels Mar 1, 2026
@mushrowan
Copy link
Contributor Author

spellcheck issue is handled in #24818

@mushrowan mushrowan changed the title refactor(host_metrics source): replace heim with sysinfo for load/hos… enhancement(host_metrics source): replace heim with sysinfo for load/host metrics Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: ci Anything related to Vector's CI environment domain: sources Anything related to the Vector's sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant