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
  • Loading branch information
lahwaacz committed Oct 3, 2021
1 parent e27581d commit b11e0fe
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 @@ -375,6 +375,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 b11e0fe

Please sign in to comment.