Skip to content

feat(inputs.smartctl): device name to attribute metrics#18679

Draft
hackery wants to merge 2 commits intoinfluxdata:masterfrom
hackery:feat/inputs-smartctl-attribute-tag
Draft

feat(inputs.smartctl): device name to attribute metrics#18679
hackery wants to merge 2 commits intoinfluxdata:masterfrom
hackery:feat/inputs-smartctl-attribute-tag

Conversation

@hackery
Copy link
Copy Markdown
Contributor

@hackery hackery commented Apr 9, 2026

Summary

Optional metric_version flag changes tag usage in the smartctl_attributes metrics to make name the device name (consistent with its use in the smartctl metrics) and putting the attribute name in a new attribute tag.

I don't know if this is the correct way to achieve this. metric_version is used elsewhere for similar purposes, but here seems a bit of a sledgehammer for a single tag name change. Would welcome alternative suggestions and quite prepared for PR to be rejected.

Checklist

Related issues

resolves #18385

Optional `metric_version` flag changes tag usage in the
`smartctl_attributes` metrics to make `name` the device name (consistent
with its use in the `smartctl` metrics) and putting the attribute name
in a new `attribute` tag.
@telegraf-tiger telegraf-tiger bot added 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 Apr 9, 2026
Comment thread plugins/inputs/smartctl/sample.conf Outdated
## making it harder to associate them to the "smartctl" metrics.
## metric_version = 2 will use the "name" tag for the the device name,
## and a new "attribute" tag for the attribute name.
metric_version = 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Default values can be commented out

Suggested change
metric_version = 1
# metric_version = 1

@hackery
Copy link
Copy Markdown
Contributor Author

hackery commented Apr 9, 2026

@srebhan via Slack suggested using a more specific option like enforce_device_name_tag, and also asked for a unit test to be added. I hope to get to that today and will update PR.

@Hipska
Copy link
Copy Markdown
Contributor

Hipska commented Apr 9, 2026

If your PR is not ready to be reviewed, please mark it as Draft.

@telegraf-tiger
Copy link
Copy Markdown
Contributor

telegraf-tiger bot commented Apr 9, 2026

@hackery hackery marked this pull request as draft April 15, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[[inputs.smartctl]] conflates name label for device name and attribute name

2 participants