Skip to content

Commit b832e55

Browse files
authored
Merge pull request #28 from lahwaacz/master
Skip vendor-specific statistics that lead to duplicate metric labels
2 parents cee06ec + e76e458 commit b832e55

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: smartctl.go

+5
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,11 @@ func (smart *SMARTctl) mineSmartStatus() {
331331
func (smart *SMARTctl) mineDeviceStatistics() {
332332
for _, page := range smart.json.Get("ata_device_statistics.pages").Array() {
333333
table := strings.TrimSpace(page.Get("name").String())
334+
// skip vendor-specific statistics (they lead to duplicate metric labels on Seagate Exos drives,
335+
// see https://github.com/Sheridan/smartctl_exporter/issues/3 for details)
336+
if table == "Vendor Specific Statistics" {
337+
continue
338+
}
334339
for _, statistic := range page.Get("table").Array() {
335340
smart.ch <- prometheus.MustNewConstMetric(
336341
metricDeviceStatistics,

0 commit comments

Comments
 (0)