Skip to content

Commit

Permalink
Merge pull request #28 from lahwaacz/master
Browse files Browse the repository at this point in the history
Skip vendor-specific statistics that lead to duplicate metric labels
  • Loading branch information
SuperQ authored Oct 20, 2022
2 parents cee06ec + e76e458 commit b832e55
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 @@ -331,6 +331,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 b832e55

Please sign in to comment.