feat(inputs.system): Add hardware information#18868
Merged
Merged
Conversation
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Contributor
Author
|
@skartikey @srebhan @Hipska Hi, could you take a look at this PR when you have a moment? |
srebhan
reviewed
May 8, 2026
Hipska
reviewed
May 9, 2026
srebhan
reviewed
May 11, 2026
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Contributor
Author
srebhan
approved these changes
May 11, 2026
Replace the cached telegraf.Metric (mutated via SetTime on every Gather) with a cached fields map, mirroring the os_cache_ttl pattern. Add a dmi_cache_ttl config option (default 8h) so the cache can be refreshed. Track dmi-enabled state on the struct instead of mutating s.Include on unsupported platforms.
Contributor
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
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
This is the third step of the plan agreed in #18533: add a
hardwarevalue to theincludeoption ofinputs.systemthat emits a separatesystem_hardwaremeasurement with BIOS, baseboard, chassis and product information from DMI/SMBIOS.The data is gathered through
github.com/jaypipes/ghwfor cross-platform support. On Linux ghw reads from/sys/class/dmi/id/and does not require root access for most fields; only serial numbers and asset tags are restricted by the kernel. On Windows ghw queries WMI. macOS, BSD and Solaris are not supported by ghw, so on those platformsInitlogs a warning and the metric is not emitted, mirroring the pattern used ininputs.memforcollect_extended.The result is cached for
hardware_cache_ttl(default8h) between gathers since DMI/SMBIOS data is effectively static for the life of the machine; the TTL handling matches the convention used foros_cache_ttlintroduced in #18834.Fields emitted by the
system_hardwaremeasurementbios_vendorbios_versionbios_dateboard_vendorboard_productboard_versionchassis_vendorchassis_typechassis_type_descriptionDesktop,Notebook)chassis_versionproduct_vendorproduct_nameproduct_familyFor
chassis_typeboth the raw code and the human-readable description are emitted, similar to howinputs.burrowandinputs.cephexposestatus_codealongsidestatus.Fields whose value cannot be determined are omitted from the metric.
Backward compatibility
The default
includeset is unchanged, so existing deployments keep emitting only thesystemmeasurement and do not see the newsystem_hardwaremetric until they opt in.Example output
Checklist