prometheus / prometheus/node_exporter

duplicated readings on Smartctl

Open
#1,867 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.8k
Forks
2.7k
Avg merge
1d 23h
Merged PRs (30d)
8

Description

5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
prometheus-node-exporter-collectors/focal,focal,now 0+git20200110.fc91c86-1 all [installed,automatic]
prometheus-node-exporter/focal,now 0.18.1+ds-2 amd64 [installed]

ARGS="--no-collector.xfs"
Running from host (we have no virtualizations)

What did you do that produced an error?

journalctl -f

What did you expect to see?

no error message

What did you see instead?
error gathering metrics: 4 error(s) occurred:
* [from Gatherer #2] collected metric "smartmon_raw_read_error_rate_worst" { label:<name:"disk" value:"/dev/sdb" > label:<name:"smart_id" value:"1" > label:<name:"type" value:"sat" > gauge:<value:0 > } was collected before with the same name and label values
* [from Gatherer #2] collected metric "smartmon_raw_read_error_rate_threshold" { label:<name:"disk" value:"/dev/sdb" > label:<name:"smart_id" value:"1" > label:<name:"type" value:"sat" > gauge:<value:0 > } was collected before with the same name and label values
* [from Gatherer #2] collected metric "smartmon_raw_read_error_rate_value" { label:<name:"disk" value:"/dev/sdb" > label:<name:"smart_id" value:"1" > label:<name:"type" value:"sat" > gauge:<value:0 > } was collected before with the same name and label values
* [from Gatherer #2] collected metric "smartmon_raw_read_error_rate_raw_value" { label:<name:"disk" value:"/dev/sdb" > label:<name:"smart_id" value:"1" > label:<name:"type" value:"sat" > gauge:<value:2.199023e+12 > } was collected before with the same name and label values

indeed those lines are duplicated in the collector text file smartmon.prom

# HELP smartmon_raw_read_error_rate_raw_value SMART metric raw_read_error_rate_raw_value
# TYPE smartmon_raw_read_error_rate_raw_value gauge
smartmon_raw_read_error_rate_raw_value{disk="/dev/sdb",type="sat",smart_id="1"} 0.000000e+00
smartmon_raw_read_error_rate_raw_value{disk="/dev/sdb",type="sat",smart_id="1"} 2.199023e+12
# HELP smartmon_raw_read_error_rate_threshold SMART metric raw_read_error_rate_threshold
# TYPE smartmon_raw_read_error_rate_threshold gauge
smartmon_raw_read_error_rate_threshold{disk="/dev/sdb",type="sat",smart_id="1"} 0
smartmon_raw_read_error_rate_threshold{disk="/dev/sdb",type="sat",smart_id="1"} 0
# HELP smartmon_raw_read_error_rate_value SMART metric raw_read_error_rate_value
# TYPE smartmon_raw_read_error_rate_value gauge
smartmon_raw_read_error_rate_value{disk="/dev/sdb",type="sat",smart_id="1"} 0
smartmon_raw_read_error_rate_value{disk="/dev/sdb",type="sat",smart_id="1"} 0
# HELP smartmon_raw_read_error_rate_worst SMART metric raw_read_error_rate_worst
# TYPE smartmon_raw_read_error_rate_worst gauge
smartmon_raw_read_error_rate_worst{disk="/dev/sdb",type="sat",smart_id="1"} 0
smartmon_raw_read_error_rate_worst{disk="/dev/sdb",type="sat",smart_id="1"} 0

but are ok in the source

root@chi408:/var/lib/prometheus/node-exporter# smartctl -a /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-42-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     SATADOM-SL 3ME
Serial Number:    20150612AA1004102521
Firmware Version: S140714
User Capacity:    64,023,257,088 bytes [64.0 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-2 (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Wed Oct 14 09:35:05 2020 CDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
Total time to complete Offline
data collection:                (   32) seconds.
Offline data collection
capabilities:                    (0x00)         Offline data collection not supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x00) Error logging NOT supported.
                                        General Purpose Logging supported.
SCT capabilities:              (0x0039) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x0000   000   000   000    Old_age   Offline      -       0
  2 Throughput_Performance  0x0000   000   000   000    Old_age   Offline      -       0
  3 Spin_Up_Time            0x0000   000   000   000    Old_age   Offline      -       0
  5 Reallocated_Sector_Ct   0x0002   100   100   000    Old_age   Always       -       0
  7 Unknown_SSD_Attribute   0x0000   000   000   000    Old_age   Offline      -       0
  8 Unknown_SSD_Attribute   0x0000   000   000   000    Old_age   Offline      -       0
  9 Power_On_Hours          0x0002   100   100   000    Old_age   Always       -       20376
 10 Unknown_SSD_Attribute   0x0000   000   000   000    Old_age   Offline      -       0
 12 Power_Cycle_Count       0x0002   100   100   000    Old_age   Always       -       61
168 Unknown_Attribute       0x0000   000   000   000    Old_age   Offline      -       0
169 Unknown_Attribute       0x0000   000   000   000    Old_age   Offline      -       0
175 Program_Fail_Count_Chip 0x0000   000   000   000    Old_age   Offline      -       0
192 Power-Off_Retract_Count 0x0000   000   000   000    Old_age   Offline      -       0
  1 Raw_Read_Error_Rate     0x0000   000   000   000    Old_age   Offline      -       2199023255552
197 Current_Pending_Sector  0x0000   000   000   000    Old_age   Offline      -       0
240 Unknown_SSD_Attribute   0x0000   000   000   000    Old_age   Offline      -       0
225 Unknown_SSD_Attribute   0x0000   000   000   000    Old_age   Offline      -       0
170 Unknown_Attribute       0x0003   100   100   ---    Pre-fail  Always       -       2949120
173 Unknown_Attribute       0x0002   100   100   ---    Old_age   Always       -       35258824
229 Unknown_Attribute       0x0002   100   100   ---    Old_age   Always       -       4415368631704
236 Unknown_Attribute       0x0002   100   100   ---    Old_age   Always       -       0
235 Unknown_Attribute       0x0002   100   000   ---    Old_age   Always       -       0
176 Erase_Fail_Count_Chip   0x0000   100   000   ---    Old_age   Offline      -       0

Read SMART Log Directory failed: scsi error badly formed scsi parameters

SMART Error Log not supported

SMART Self-test Log not supported

Selective Self-tests/Logging not supported

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with smartctl -a /dev/sdb and inspect the generated smartmon.prom output; the issue shows duplicate SMART attribute readings for the same disk and metric labels. Trace how that output is collected and parsed, then verify that the exporter no longer emits duplicate metrics or the reported gathering error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.