Skip to content

Commit

Permalink
skip vendor-specific statistics that lead to duplicate metric labels
Browse files Browse the repository at this point in the history
fixes #3

Signed-off-by: Jakub Klinkovský <j.l.k@gmx.com>
  • Loading branch information
lahwaacz committed Oct 14, 2022
1 parent d3d5180 commit e10ded5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions smartctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ func (smart *SMARTctl) mineSmartStatus() {
func (smart *SMARTctl) mineDeviceStatistics() {
for _, page := range smart.json.Get("ata_device_statistics.pages").Array() {
table := strings.TrimSpace(page.Get("name").String())
// skip vendor-specific statistics (they lead to duplicate metric labels on Seagate Exos drives,
// see https://github.com/Sheridan/smartctl_exporter/issues/3 for details)
if table == "Vendor Specific Statistics" {
continue;
}
for _, statistic := range page.Get("table").Array() {
smart.ch <- prometheus.MustNewConstMetric(
metricDeviceStatistics,
Expand Down

0 comments on commit e10ded5

Please sign in to comment.