prometheus / prometheus/node_exporter
Number of PIDs is wrong
Nobody has claimed this yet.
- 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 localhost.localdomain 5.14.0-22.el9.x86_64 #1 SMP Fri Nov 26 23:47:21 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
./node_exporter --collector.processes
Are you running node_exporter in Docker?
No
What did you do that produced an error?
curl http://localhost:9100/metrics
What did you expect to see?
# HELP node_processes_pids Number of PIDs
# TYPE node_processes_pids gauge
node_processes_pids 241
# HELP node_processes_threads Allocated threads in system
# TYPE node_processes_threads gauge
node_processes_threads 241
What did you see instead?
# HELP node_processes_pids Number of PIDs
# TYPE node_processes_pids gauge
node_processes_pids 121
# HELP node_processes_threads Allocated threads in system
# TYPE node_processes_threads gauge
node_processes_threads 241
Value of Number of PIDs get from number of process. It is wrong at linux system, because each thread allocate one pid. not each process.
We can fix it and provide one more "Number of Process"
Number of PIDs = threads
Number of Process = pids
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 in collector/processes_linux.go around line 112 and reproduce the reported metrics with --collector.processes and a request to /metrics. Check the Linux distinction between process IDs and thread IDs, then ensure the exported metrics use the intended meanings. Done means the PID and process counts are correct and the existing thread count remains accurate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100