node_processes_* metrics is missing in 0.18.1

40 views
Skip to first unread message

Nirmal Nath

unread,
Apr 7, 2020, 7:38:41 AM4/7/20
to Prometheus Users

Host operating system: Linux f40d06280e9a 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


node_exporter version: node_exporter, version 0.18.1 (branch: HEAD, revision: 3db7773)

build user: root@b50852a1acba
build date: 20190604-16:41:18
go version: go1.12.5


node_exporter command line flags: Nil


What did you do that produced an error? Check for the node_processor metrics which was added in #950


What did you expect to see?

$ curl -s localhost:9100/metrics | grep '^node_processes_pids '
node_processes_pids 159


What did you see instead?

$ curl -s localhost:9100/metrics | grep '^node_processes_pids '
$

---------------------------------------------------------------------------------------

I have enabled it using.

sysctl -w kernel.perf_event_paranoid=-1

kernel.perf_event_paranoid = -1

curl -s localhost:9100/metrics | grep node_process

Do I have to add any additional command line flags?


---------------------------------------------------------------------------------------


Can someone please help me?


Brian Candler

unread,
Apr 7, 2020, 7:55:59 AM4/7/20
to Prometheus Users
It's a disabled-by-default exporter:

Yes, you have to enable it with a command line flag.

Collectors are enabled by providing a --collector.<name> flag. Collectors that are enabled by default can be disabled by providing a --no-collector.<name> flag.

Nirmal Nath

unread,
Apr 7, 2020, 8:28:31 AM4/7/20
to Prometheus Users
Thank you so much,

Now my problem is half solved. The metric is showing the list of pid/threads of all the users. Can I get the threads of a specific user?

Brian Candler

unread,
Apr 7, 2020, 8:49:13 AM4/7/20
to Prometheus Users
Show an example?

If there is a label giving the username/userid, you can filter the query with promQL.

Nirmal Nath

unread,
Apr 7, 2020, 9:04:49 AM4/7/20
to Prometheus Users
There are no labels by default. 

eg: 
We have user 'xyz' and 'root'. PID's for xyz is 5 and for root is 15 and our metrics 'node_processes_pids' output is 20. I need to know only the PID of 'xyz'.
Screenshot 2020-04-07 at 6.27.11 PM.png

Brian Candler

unread,
Apr 7, 2020, 9:51:49 AM4/7/20
to Prometheus Users
Then the exporter doesn't appear to give separate metrics for pids broken down by user.  You could write some code to do this yourself (e.g. with "ps") and write out a file to be picked up by textfile_collector.

Nirmal Nath

unread,
Apr 8, 2020, 4:22:15 AM4/8/20
to Prometheus Users
Thanks a lot again. 

I didn't know about the textfile_collector. Read about it and its perfect for me. Added a script to populate the textfile_collector and now getting the metrics in prom. Thank you again. :) 
Reply all
Reply to author
Forward
0 new messages