How to scrape opendj,tomcat and openam processes using process exporter in prometheus.

34 views
Skip to first unread message

Pooja Chauhan

unread,
Mar 19, 2020, 1:09:13 PM3/19/20
to Prometheus Users
Hi ,
I am using process -exporter to monitor processes in my ec2 machine which has openam,opendj and tomcat ,I need to monitor these specifc processes only for my machine.Kindly suggest me the .yml configuration and also the way to do it.Currently my .yml is like below:

process_names:
  - name: "{{.Comm}}"
    cmdline:
    - '.+'





Ashish chugh

unread,
Apr 24, 2020, 2:44:10 AM4/24/20
to Prometheus Users
Looking for Same, Is anyone who can help to get rid out from this ?

Julius Volz

unread,
Apr 24, 2020, 3:55:47 AM4/24/20
to Pooja Chauhan, Prometheus Users
You should be able to just edit the "cmdline" regex part to match only the processes that you mentioned:

process_names:
  - name: "{{.Comm}}"
    cmdline:
      - 'openam|opendj|tomcat'

Depending on the exact names of the command-lines you may need to adjust the regex or use one of the other selector types ("exe" or "comm", see https://github.com/ncabatoff/process-exporter#using-a-config-file-process-selectors).

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/4dd7807a-a58d-44a7-96f4-2c531f4ca9ad%40googlegroups.com.

Aashish chugh

unread,
Apr 24, 2020, 4:20:25 AM4/24/20
to Julius Volz, Pooja Chauhan, Prometheus Users
Thanks for your reply Julius.

One quick question can i pass the process id too , if yes how ?



--
Aashish Chugh

Julius Volz

unread,
Apr 24, 2020, 8:20:29 AM4/24/20
to Aashish chugh, Pooja Chauhan, Prometheus Users
As far as I know you cannot *select* by the process ID, but you can add the PID to the final group name label via:

process_names:
  - name: "{{.Comm}}-{{.PID}}"

    cmdline:
      - 'openam|opendj|tomcat'


That way you can split up (and filter in PromQL) the metrics by PID.
Reply all
Reply to author
Forward
0 new messages