Skip to content

(feat) integrate smartctl exporter#5164

Open
parsa97 wants to merge 1 commit intografana:mainfrom
parsa97:feat/smartctl
Open

(feat) integrate smartctl exporter#5164
parsa97 wants to merge 1 commit intografana:mainfrom
parsa97:feat/smartctl

Conversation

@parsa97
Copy link
Copy Markdown

@parsa97 parsa97 commented Jan 1, 2026

PR Description

This PR adds a new prometheus.exporter.smartctl component to Grafana Alloy for collecting hardware metrics from S.M.A.R.T enabled devices.

Which issue(s) this PR fixes

fixes: #230
fixes: #3799

Notes to the Reviewer

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

@parsa97 parsa97 requested review from a team and clayton-cornell as code owners January 1, 2026 12:10
@creyD
Copy link
Copy Markdown

creyD commented Jan 3, 2026

@parsa97 Thanks a lot for this!

Copy link
Copy Markdown
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

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

Several doc suggestions. I would like to do a second pass through the docs after the current suggestions are reviewed/implemented to see if I've missed anything.

Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Jan 6, 2026
@@ -0,0 +1,903 @@
package smartctl_exporter
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.

Is this the prometheus-community collector, just vendored into Alloy? If no, why are we not using the community exporter's collector?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It's not possible to import community package as a dependency.

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.

Hi, thank you for the PR! I'm a bit concerned with the maintenance burden when adding code like this. I have a few questions:

  • Does bundling the exporter with Alloy make much difference given that the user still has to install smartmontools? If they already have to install smartmontools, why not just also install the Prometheus exporter?
  • Would it be possible to make the community package importable? I'd consider this a pre-requisite for this PR.
  • Is there a reason why the upstream exporter doesn't use a native Go module like the one suggested here? Would they be interested in switching to it?

@parsa97
Copy link
Copy Markdown
Author

parsa97 commented Mar 8, 2026

@clayton-cornell I moved smartctl from static to components. PTAL.

@parsa97 parsa97 requested a review from dehaansa March 8, 2026 18:18
Copy link
Copy Markdown
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

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

Most changes are for consistency and active voice.

Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
Comment thread docs/sources/reference/components/prometheus/prometheus.exporter.smartctl.md Outdated
@clayton-cornell clayton-cornell requested a review from a team March 9, 2026 06:35
Comment on lines +8 to +16
tags:
- text: Community
tooltip: This component is developed, maintained, and supported by the Alloy user community.
title: prometheus.exporter.smartctl
---

# `prometheus.exporter.smartctl`

{{< docs/shared lookup="stability/community.md" source="alloy" version="<ALLOY_VERSION>" >}}
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.

I double checked and there is no Community: true that I can see in smartctl.go so... this isn't a community supported component and the community parts can be removed here.... or if it IS a community supported component, then we are missing the community part in the component.Register`?

cc: @grafana/grafana-alloy-maintainers

@ptodev ptodev self-assigned this Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/docs Docs Squad label across all Grafana Labs repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate smartctl_exporter into the Agent Add https://github.com/prometheus-community/smartctl_exporter to Alloy

5 participants