smartctl_exporter icon indicating copy to clipboard operation
smartctl_exporter copied to clipboard

/metrics shows error : was collected before with the same name and label values

Open ChaoHsupin opened this issue 2 years ago • 3 comments

Hello, thank you for your work. I met a problem , /metrics shows:

An error has occurred while serving metrics:

collected metric "smartctl_device_statistics" { label:<name:"device" value:"/dev/sdb" > label:<name:"model_family" value:"" > label:<name:"model_name" value:"ST4000NM000A-2HZ100" > label:<name:"serial_number" value:"WJG0S0A0" > label:<name:"statistic_flags_long" value:"valid" > label:<name:"statistic_flags_short" value:"V---" > label:<name:"statistic_name" value:"Vendor Specific" > label:<name:"statistic_table" value:"Vendor Specific Statistics" > gauge:<value:0 > } was collected before with the same name and label values
  • exporter in version v0.7.0

start command:

[Smartctl_Exporter]$ cat start.sh 
#!/usr/bin/env bash
exec ./smartctl_exporter --config=config.yaml --debug

logs:

[logs]$ cat stdout.log 
[Info] Starting on 0.0.0.0:9633/metrics

smartctl config:

smartctl_exporter:
  bind_to: "0.0.0.0:9633"
  url_path: "/metrics"
  fake_json: no
  smartctl_location: /usr/sbin/smartctl
  collect_not_more_than_period: 120s
  devices:
  - /dev/sda
  - /dev/sdb

disk mount info:

[logs]$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb      8:16   0  3.7T  0 disk 
└─sdb1   8:17   0  3.7T  0 part /data-hdd0
sdc      8:32   0  3.7T  0 disk 
└─sdc1   8:33   0  3.7T  0 part /data-hdd1
sda      8:0    0  3.5T  0 disk 
├─sda2   8:2    0  3.4T  0 part 
│ ├─centos-var_lib_docker
       253:1    0  200G  0 lvm  /var/lib/docker
│ ├─centos-home_work
       253:2    0  200G  0 lvm  /home/work
│ └─centos-data--ssd
       253:0    0    3T  0 lvm  /data-ssd
├─sda3   8:3    0  100G  0 part /var/lib/kubelet/pods/2f3038b1-bb8d-4da4-81a6-90
└─sda1   8:1    0    2M  0 part 

ChaoHsupin avatar Aug 12 '22 09:08 ChaoHsupin

Duplicate of #3. There is a patch: #28

lahwaacz avatar Aug 12 '22 09:08 lahwaacz

I first annotated this related code about smartctl_device_statistics metrics , compiled again, and temporarily solved the problem.

ChaoHsupin avatar Aug 13 '22 08:08 ChaoHsupin

I first annotated this related code about smartctl_device_statistics metrics , compiled again, and temporarily solved the problem.

@ChaoHsupin ... can you maybe write up a PR with the changes you made to fix this? Or is this issue not even valid anymore?

frittentheke avatar Aug 11 '23 08:08 frittentheke