prometheus / prometheus/node_exporter
feat: Add btrfs discard stats
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.8k
- Forks
- 2.7k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 8
Description
I see my drives are issuing lots of discards while moving data (unsurprisingly). It'd be nice if the node_exporter could pick up these stats
Looks like this would probably need added to https://github.com/prometheus/procfs and would be similar to commit_stats https://github.com/prometheus/procfs/pull/580
root@machine:/sys/fs/btrfs/0dee6821-7166-4f43-adc1-cf871ec53ef4# ls -al discard/
total 0
drwxr-xr-x 2 root root 0 Mar 22 17:08 .
drwxr-xr-x 7 root root 0 Mar 22 16:47 ..
-r--r--r-- 1 root root 4096 Mar 22 17:08 discard_bitmap_bytes
-r--r--r-- 1 root root 4096 Mar 22 17:08 discard_bytes_saved
-r--r--r-- 1 root root 4096 Mar 22 17:08 discard_extent_bytes
-r--r--r-- 1 root root 4096 Mar 22 17:08 discardable_bytes
-r--r--r-- 1 root root 4096 Mar 22 17:08 discardable_extents
-rw-r--r-- 1 root root 4096 Mar 22 17:08 iops_limit
-rw-r--r-- 1 root root 4096 Mar 22 17:08 kbps_limit
-rw-r--r-- 1 root root 4096 Mar 22 17:08 max_discard_size
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the node_exporter filesystem collector and the related prometheus/procfs commit_stats implementation, then inspect the btrfs discard directory under /sys/fs/btrfs//discard. Done means the listed discard statistics are read through procfs and exposed by node_exporter with appropriate coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, linux
- Domain
- observability-sre, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100