Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to differienciate mutile process with same process name? #279

Open
nickwu2008 opened this issue Sep 21, 2023 · 1 comment
Open

How to differienciate mutile process with same process name? #279

nickwu2008 opened this issue Sep 21, 2023 · 1 comment

Comments

@nickwu2008
Copy link

How to differienciate mutile process with same process name
The three processes has same process name 'padms' like below

[m119@test019 ~]$ ps -ef | grep "./padms"|grep -v test
m119    67110 147204  0 14:32 pts/13   00:00:00 ./padms
m119    67111  67110  0 14:32 pts/13   00:00:12 ./padms
m119    67345  67111  0 09:37 pts/13   00:00:04 [padms] <defunct>

I want to monitor the two process with below configration

process_names:

  - name: "{{.ExeFull}}"
    cmdline:
    - './padms'

Then observer the three processes metrics in grafana site,I only find one metrics with padms. How to differienciate the three processes ?

@tangguangliang
Copy link

tangguangliang commented Dec 7, 2023

在name中添加Pid {{.PID}}

Template variables available:

  • {{.Comm}} contains the basename of the original executable, i.e. 2nd field in /proc/<pid>/stat
  • {{.ExeBase}} contains the basename of the executable
  • {{.ExeFull}} contains the fully qualified path of the executable
  • {{.Username}} contains the username of the effective user
  • {{.Matches}} map contains all the matches resulting from applying cmdline regexps
  • {{.PID}} contains the PID of the process. Note that using PID means the group
    will only contain a single process.
  • {{.StartTime}} contains the start time of the process. This can be useful
    in conjunction with PID because PIDs get reused over time.
  • {{.Cgroups}} contains (if supported) the cgroups of the process
    (/proc/self/cgroup). This is particularly useful for identifying to which container
    a process belongs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants