Skip to content

feat(inputs.system): Add hardware information#18868

Merged
skartikey merged 23 commits into
influxdata:masterfrom
bilkoua:master
May 15, 2026
Merged

feat(inputs.system): Add hardware information#18868
skartikey merged 23 commits into
influxdata:masterfrom
bilkoua:master

Conversation

@bilkoua
Copy link
Copy Markdown
Contributor

@bilkoua bilkoua commented May 7, 2026

Summary

This is the third step of the plan agreed in #18533: add a hardware value to the include option of inputs.system that emits a separate system_hardware measurement with BIOS, baseboard, chassis and product information from DMI/SMBIOS.

The data is gathered through github.com/jaypipes/ghw for 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 platforms Init logs a warning and the metric is not emitted, mirroring the pattern used in inputs.mem for collect_extended.

The result is cached for hardware_cache_ttl (default 8h) between gathers since DMI/SMBIOS data is effectively static for the life of the machine; the TTL handling matches the convention used for os_cache_ttl introduced in #18834.

Fields emitted by the system_hardware measurement

Field Type Source
bios_vendor string BIOS information
bios_version string BIOS information
bios_date string BIOS information
board_vendor string Baseboard / motherboard
board_product string Baseboard / motherboard
board_version string Baseboard / motherboard
chassis_vendor string Chassis / enclosure
chassis_type string Chassis type code (numeric, per SMBIOS DSP0134)
chassis_type_description string Chassis type description (e.g. Desktop, Notebook)
chassis_version string Chassis / enclosure
product_vendor string System product
product_name string System product
product_family string System product

For chassis_type both the raw code and the human-readable description are emitted, similar to how inputs.burrow and inputs.ceph expose status_code alongside status.

Fields whose value cannot be determined are omitted from the metric.

Backward compatibility

The default include set is unchanged, so existing deployments keep emitting only the system measurement and do not see the new system_hardware metric until they opt in.

Example output

system_hardware,host=worker-01 bios_vendor="Dell Inc.",bios_version="2.18.0",bios_date="04/12/2024",board_vendor="Dell Inc.",board_product="0X3D66",chassis_vendor="Dell Inc.",chassis_type="23",chassis_type_description="Rack mount chassis",product_vendor="Dell Inc.",product_name="PowerEdge R750" 1748000000000000000

Checklist

@telegraf-tiger telegraf-tiger Bot added area/system feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels May 7, 2026
@bilkoua
Copy link
Copy Markdown
Contributor Author

bilkoua commented May 7, 2026

@skartikey @srebhan @Hipska Hi, could you take a look at this PR when you have a moment?

Copy link
Copy Markdown
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @bilkoua! Some comments from my side...

Comment thread plugins/inputs/system/README.md Outdated
Comment thread plugins/inputs/system/README.md Outdated
Comment thread plugins/inputs/system/system.go Outdated
Comment thread plugins/inputs/system/system.go Outdated
Comment thread plugins/inputs/system/system.go Outdated
@srebhan srebhan self-assigned this May 8, 2026
Comment thread plugins/inputs/system/system.go Outdated
Copy link
Copy Markdown
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @bilkoua! A few more comments with the most important one being that we cannot gather in Init...

Comment thread plugins/inputs/system/system.go Outdated
Comment thread plugins/inputs/system/system.go Outdated
Comment thread plugins/inputs/system/system.go Outdated
Comment thread plugins/inputs/system/system_test.go Outdated
bilkoua and others added 4 commits May 11, 2026 11:23
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>
@bilkoua
Copy link
Copy Markdown
Contributor Author

bilkoua commented May 11, 2026

@srebhan @Hipska Thanks for the review!
Could you take another look?

Copy link
Copy Markdown
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks @bilkoua!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label May 11, 2026
@srebhan srebhan assigned skartikey and unassigned srebhan 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.
Copy link
Copy Markdown
Contributor

@skartikey skartikey left a comment

Choose a reason for hiding this comment

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

@bilkoua Thanks for the contribution!

@telegraf-tiger
Copy link
Copy Markdown
Contributor

@skartikey skartikey merged commit 381ccd0 into influxdata:master May 15, 2026
27 checks passed
@github-actions github-actions Bot added this to the v1.39.0 milestone May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/system feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants