04 Jul 2025
08:50 PM
- last edited on
07 Jul 2025
09:43 AM
by
IzabelaRokita
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
04 Jul 2025 11:01 PM
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.
12 Jul 2025 05:34 PM
@Julius_Loman thank you for the response. This process is not deep monitored hence declarative process group worked for me.
05 Jul 2025 07:11 AM
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.
Regards, Deni
12 Jul 2025 06:49 PM - edited 13 Jul 2025 09:53 PM
@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 with full 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 full command line argument in rule.
Dynatrace treats part of argument as separate arguments, which are processed separately
Also, apart from PYTHON-PROCESS1, PYTHON-PROCESS2 strangely there is onemore process group with the name service.py reported in Dynatrace. For which, the command line argument is appropriate:
python service.py -m PROCESS1 -i 0123
Whenever we perform 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 need’s to be done to achieve process group availability monitoring of those processes.
Regards,
AK
15 Jul 2025 07:48 AM
@gencheva @Julius_Loman any view on above?
15 Jul 2025 11:32 AM
Hi @AK,
I’m not sure I fully understand the problem. I have a few questions to clarify things (let’s focus on process 1 as an example—it should be the same for the others):
1. Does Dynatrace detect your process 1 on both hosts without any additional configuration (even if they are in different process groups)?
As far as I understand, it’s not necessary for a process to be deep monitored. It can still be detected if at least 3 out of the last 5 one-minute intervals meet one of these conditions:
Avg(CPU) > 5%
Max(Memory) > 5%
Network Traffic > 5%
Or if the process has been defined as important (for example, by enabling Log Monitoring for it).
2. If the process is not detected by Dynatrace (e.g., it’s not considered an important process), what do you use to make Dynatrace detect it?
Do you use a Simple Detection Rule?
If yes, could you please share the configuration?
3. Why do you need “Declarative Process Grouping”?
Do you see both processes, but they appear in different groups?
If yes:
What are their group names in Dynatrace?
What additional information does Dynatrace provide about each group?
Regards,
Deni