prometheus / prometheus/node_exporter

node_md_state did not capture "removed" state

Open
#2,384 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Host operating system: output of uname -a

Linux sds-3 4.18.0-305.7.1.el8_4.x86_64 #1 SMP Tue Jun 29 21:55:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

node_exporter, version 1.3.1 (branch: HEAD, revision: a2321e7b940ddcff26873612bccdf7cd4c42b6b6)
build user: root@243aafa5525c
build date: 20211205-11:09:49
go version: go1.17.3
platform: linux/amd64

node_exporter command line flags
/usr/local/bin/node_exporter --path.procfs=/proc --path.sysfs=/sys --collector.filesystem.ignored-mount-points="^/(dev|proc|sys|var/lib/docker/.+)($|/)" --collector.filesystem.ignored-fs-types="^(autofs|binfmt_misc|cgroup|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|sysfs|tracefs)$" --no-collector.wifi
Are you running node_exporter in Docker?

no

What did you do that produced an error?

mdadm -D output

/dev/md125:
           Version : 1.0
     Creation Time : Mon Jul  5 19:40:20 2021
        Raid Level : raid1
        Array Size : 614336 (599.94 MiB 629.08 MB)
     Used Dev Size : 614336 (599.94 MiB 629.08 MB)
      Raid Devices : 2
     Total Devices : 1
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Sun May 22 01:00:01 2022
             State : clean, degraded
    Active Devices : 1
   Working Devices : 1
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

              Name : sds-3:boot_efi  (local to host sds-3)
              UUID : 312be27c:732e4a9e:6b279d78:10cd6a6a
            Events : 177

    Number   Major   Minor   RaidDevice State
       -       0        0        0      removed
       1       8       18        1      active sync   /dev/sdb2
What did you expect to see?

node_md_state{device="md125", instance="sds-3", job="sds-nodes", state="removed"}

What did you see instead?

"removed" state metric not yet implemented in node_md_state

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

Start by locating the node_md_state collector and the code that parses mdadm -D output. Reproduce the RAID1 case with a removed device and inspect the collector's existing state handling. Done means node_md_state exposes state="removed" for the affected array, with collector tests covering the output.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
observability, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.