Giter Site home page Giter Site logo

Comments (7)

ncabatoff avatar ncabatoff commented on May 28, 2024

By default, unless you run it with -children=false, it will group all processes that don't match a different config section into the same section as their parent. See what ps axuwf reports, and take a look at the namedprocess_namegroup_num_procs gauge.

from process-exporter.

n1nj4z33 avatar n1nj4z33 commented on May 28, 2024

Hi,

ps auxwf | grep postgres
root     13977  0.0  0.0 103324   852 pts/4    S+   10:48   0:00          \_ grep postgres
postgres  3201  0.0  0.0 187028  4316 ?        S    Aug08   0:02 /usr/pgsql-9.6/bin/postmaster -D /u01/postgres
postgres  3203  0.0  0.0 184900  1452 ?        Ss   Aug08   0:00  \_ postgres: logger process                      
postgres  3205  0.0  0.0 187160  2060 ?        Ss   Aug08   0:02  \_ postgres: checkpointer process                
postgres  3206  0.0  0.0 187028  1580 ?        Ss   Aug08   0:00  \_ postgres: writer process                      
postgres  3207  0.0  0.0 187028  1640 ?        Ss   Aug08   0:00  \_ postgres: wal writer process                  
postgres  3208  0.0  0.0 188140  2448 ?        Ss   Aug08   0:00  \_ postgres: autovacuum launcher process         
postgres  3209  0.0  0.0 191168  5268 ?        Ss   Aug08   0:21  \_ postgres: stats collector process             
postgres  3237  0.0  0.0 193420  8188 ?        Ss   Aug08   0:03  \_ postgres: postgres postgres 127.0.0.1(36327) idle

All postgres processes are childrens of postmaster
I run with children=false or true but nothing changed
In the results only two children process are found

namedprocess_namegroup_num_procs
postgres: logger process 1
postgres: stats collector process 1

How can I collect all of postgres childrens separately ?
or may be there is a way to combine it to one postmaster process ?

And no one postgres or postmaster process are found by

cmdline:
  - '.+'

from process-exporter.

wenfei3 avatar wenfei3 commented on May 28, 2024

Well, may be I have the same question.
Here are all the processes what I want to collect,include sixteen processes named batman and one process named sidekiq xxx batman

ps auxwf|grep batman
root     19568  0.0  0.0 103264   844 pts/1    S+   20:11   0:00                          \_ grep batman
deploy   11731 12.6  6.3 5570140 2091580 ?     Sl   Aug07 981:48 sidekiq 4.2.10 batman [0 of 35 busy]
deploy   12406  0.0  0.3 393752 127852 ?       Sl   Aug07   0:07 unicorn master -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   23635  2.5  0.7 864948 243832 ?       Sl   Aug10 103:02  \_ unicorn worker[14] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   19456  2.2  0.7 870876 250088 ?       Sl   02:14  24:14  \_ unicorn worker[0] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   24120  2.2  0.7 858580 239856 ?       Sl   02:15  24:04  \_ unicorn worker[9] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   24416  2.2  0.6 834340 216560 ?       Sl   02:15  24:39  \_ unicorn worker[2] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   24496  2.3  0.6 844020 222728 ?       Sl   02:15  24:54  \_ unicorn worker[8] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   24665  2.2  0.6 841780 219952 ?       Sl   02:15  24:30  \_ unicorn worker[5] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   24728  2.2  0.7 865060 243792 ?       Sl   02:15  24:30  \_ unicorn worker[4] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   24915  2.1  0.6 839096 217880 ?       Sl   02:15  23:29  \_ unicorn worker[1] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   24918  2.2  0.7 868380 245696 ?       Sl   02:15  24:01  \_ unicorn worker[6] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   24921  2.1  0.6 839104 221352 ?       Sl   02:15  22:41  \_ unicorn worker[12] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   25529  2.2  0.6 848428 228476 ?       Sl   02:15  24:13  \_ unicorn worker[3] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   25532  2.3  0.7 856024 240504 ?       Sl   02:15  25:21  \_ unicorn worker[11] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   27056  2.3  0.6 842908 221744 ?       Sl   02:16  24:44  \_ unicorn worker[13] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   31434  2.2  0.7 841436 230408 ?       Sl   02:17  24:29  \_ unicorn worker[10] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D
deploy   31438  2.2  0.6 850824 229468 ?       Sl   02:17  24:31  \_ unicorn worker[7] -c /opt/work/batman/current/config/unicorn/production.rb -E deployment -D

and here is my yml file

process_names:
  - name: "batman"
    comm:
    - ruby
    cmdline:
    - ^unicorn\s.+batman.+production.rb\s.+
  - name: "sidekiq-batman"
     comm:
     - ruby
     cmdline:
    - ^sidekiq\s.+batman.*

now I could collect the process info of batman without sidekiq-batman. The regex is right, so what's my problem?I have been stuck for two days...Thanks for any suggestion!

from process-exporter.

ncabatoff avatar ncabatoff commented on May 28, 2024

The newest pre-release 0.3.7 includes a -debug option that may answer your question. I suggest using it with the -once-to-stdout option as it produces quite a lot of output.

from process-exporter.

wenfei3 avatar wenfei3 commented on May 28, 2024

Wow,thank you very much for newest process_exportert.I have tried to use option -debug and -once-to-stdout for my process_exporter.

./process-exporter -config.path process-exporter.yaml -debug -once-to-stdout >log 2>&1

And I could read the log 'reading metrics for Pid xxxx'

2018/08/13 14:14:12 Reading metrics from /proc based on "process-exporter.yaml"
2018/08/13 14:14:12 using config matchnamer: [[comms: [ruby] cmdlines: [^unicorn\s.+batman.+production.rb\s.+]] [comms: [ruby] cmdlines: [^unicorn\s.+waka.+production.rb\s.+]] [comms: [ruby] cmdline
s: [^unicorn\s.+fishtrip.+production.rb\s.+]] [comms: [ruby] cmdlines: [^unicorn\s.+hunter-x-hunter.+production.rb\s.+]] [comms: [ruby] cmdlines: [^unicorn\s.+finder.+production.rb\s.+]] [comms: [ru
by] cmdlines: [^sidekiq\s.+batman.*]] [comms: [ruby] cmdlines: [^sidekiq\s.+waka.*]] [comms: [ruby] cmdlines: [^sidekiq\s.+fishtrip.*]] [comms: [ruby] cmdlines: [^sidekiq\s.+hunter-x-hunter.*]] [com
ms: [ruby] cmdlines: [^sidekiq\s.+finder.*]] [comms: [ruby] cmdlines: [^/opt.+batman.+rake]] [comms: [ruby] cmdlines: [^/opt.+hunter-x-hunter.+rake]]]
2018/08/13 14:14:12 found new proc: {Pid:1 StartTimeRel:3}:{Name:init Cmdline:[/sbin/init] ParentPid:0 StartTime:2016-12-16 03:15:19.03 +0000 UTC EffectiveUID:0}
2018/08/13 14:14:12 error reading metrics for {Pid:2 StartTimeRel:3}: EOF
2018/08/13 14:14:12 error reading metrics for {Pid:3 StartTimeRel:3}: EOF
2018/08/13 14:14:12 error reading metrics for {Pid:4 StartTimeRel:3}: EOF
2018/08/13 14:14:12 error reading metrics for {Pid:5 StartTimeRel:3}: EOF
...

Could all Pids be captured by process_exporter ? I couldn't find the Pid:4168 in the log.

ps -ef|grep sidekiq
deploy    4168     1  6 14:04 ?        00:01:04 sidekiq 4.2.10 batman [0 of 35 busy]

I could find the 4168 process in the path /proc/4168.
So,I think it's pivotal.
Thanks for your help once more!

from process-exporter.

wenfei3 avatar wenfei3 commented on May 28, 2024

I think my problem has been solved.
The question is I used wrong version which is pre-linux-386 for my amd64 linux OS.
Thanks for your help!

from process-exporter.

ncabatoff avatar ncabatoff commented on May 28, 2024

Great!

from process-exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.