cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Process group detection rule

AK
Pro

 

Hello Folks,

Need some help in configuring process group detection rule, use case is:

Multiple python processes are running across two hosts. We need Dynatrace identify each as a individual process group.

Default process group detection rule detecting it as single process group and command line argument shown also vary randomly for detected process group

Host1 will be having:

python service.py -m PROCESS1 -i 0123
python service.py -m PROCESS2 -i 4567
python service.py -m PROCESS3 -i 6789

Same set of processes are present on other host too.

Host2:

python service.py -m PROCESS1 -i 0123
python service.py -m PROCESS2 -i 4567
python service.py -m PROCESS3 -i 6789

I'm expecting Dynatrace to create process group like below,

PROCESS1 (ProcessGroup1)
- PROCESS1 (Process Group Instance from Host1)
- PROCESS1 (Process Group Instance from Host2)
PROCESS2 (ProcessGroup2)
- PROCESS2 (Process Group Instance from Host1)
- PROCESS2 (Process Group Instance from Host2)
PROCESS3 (ProcessGroup3)
- PROCESS3 (Process Group Instance from Host1)
- PROCESS3 (Process Group Instance from Host2)

How can we achieve this? Kindly help.

Regards,

AK

4 REPLIES 4

Julius_Loman
DynaMight Legend
DynaMight Legend

First of all, both hosts must be in the same host group.
The most straightforward solution is to use a Simple detection rule and utilise two environment variables for determining the process group and instance id. You can use your own ones (preferred) or the DT_CLUSTER_ID and DT_NODE_ID.
If you can't use environment variables, you can define advanced detection rule too based on the -m parameter.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

@Julius_Loman thank you for the response. This process is not deep monitored hence declarative process group worked for me.

gencheva
Contributor

Hi @AK ,

I'm fighting a similar problem and succeeded with only with 2 python files on two host connected with a single process group. How this works (at least on my side):

1. My two host has not assigned to a hosts group (e.g. they are not in different hosts groups)

2. Use command: setproctitle.setproctitle("test_process") in both processes (before that Dynatrace detected their names randomly and putted them in different process groups - e.g. pytho3 on one of the hosts, filename on the other ...).

3. I don't need detection rule, because the process were automatically detected by Dynatrace - e.g. https://docs.dynatrace.com/docs/observe/infrastructure-monitoring/process-groups/basic-concepts/whic... - in my case I have open port and network traffic.

gencheva_0-1751695813260.png

 

gencheva_1-1751695833197.png

Regards, Deni

@gencheva thank you for the response.
As per the rule it is working as expected however, for detected process group (PYTHON-PROCESS1), the command line argument properties shows below command line argument:

/bin/bash /somedirectory/servicestatus/start-service.sh -m PROCESS1 -i 0123

I'm expecting to see below command line argument:

python service.py -m PROCESS1 -i 0123

Following is the rule applied for PYTHON-PROCESS1 process group:

Command line argument $contains(PROCESS1)

I tried adding rule for whole command line argument but it didn't worked.

Command line argument $contains(python service.py -m PROCESS1 -i 0123)

I think, we can't add whole command line argument in rule.
Dynatrace treats part of argument as separate arguments, which are processed separately

AK_0-1752342408806.png

Also, apart from PYTHON-PROCESS1PYTHON-PROCESS2 there is only one service.py process group reported in Dynatrace. For which, the command line argument is appropriate:

python service.py -m PROCESS1 -i 0123

Whenever we do a restart of any process, the command line argument for this PG (service.py) changes to that process. For example:- if restart process3 is performed, then command line argument shown for service.py would be:

python service.py -m PROCESS3 -i 6789

@gencheva @Julius_Loman any suggestion how we can correct this detection rule? and also stops reporting of service.py process group?
Note: All these configurations needs to be done to monitor process group availability of those processes.

Regards,
AK

Featured Posts