# Process group detection rule

**URL:** <https://community.dynatrace.com/t/process-group-detection-rule/52361>\
**Category:** Open Q&A\
**Tags:** process-detection, python, processes\
**Created:** [July 4, 2025, 7:50pm UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361 "2025-07-04T19:50:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [July 4, 2025, 7:50pm UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361/1 "2025-07-04T19:50:07Z")

</div>

Hello Folks,

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

Multiple python processes are running across two hosts. We&nbsp;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:**

```markup
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:**

```markup
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,

```markup
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

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [July 4, 2025, 10:01pm UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361/2 "2025-07-04T22:01:55Z")

</div>

First of all, both hosts must be in the same host group.  
The most straightforward solution is to use a [Simple detection rule](https://docs.dynatrace.com/docs/shortlink/process-groups)&nbsp;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.

---

<div class="post-metadata">

**Author:** ![deni](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/deni/32/163_2.png) [@deni](https://community.dynatrace.com/u/deni)\
**Post date:** [July 5, 2025, 6:11am UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361/3 "2025-07-05T06:11:00Z")

</div>

Hi [@AK](https://community.dynatrace.com/user/2080) ,

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/which-are-the-most-important-processes](https://docs.dynatrace.com/docs/observe/infrastructure-monitoring/process-groups/basic-concepts/which-are-the-most-important-processes) - in my case I have open port and network traffic.

 ![gencheva_0-1751695813260.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/e/0e998b1fbff15bd05afa956e763b66f9234cb344.png)

 ![gencheva_1-1751695833197.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/b/eb9b502d2bf521598dc46e6af6f511ee791859cd.png)

Regards, Deni

---

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [July 12, 2025, 4:34pm UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361/4 "2025-07-12T16:34:35Z")

</div>

[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;thank you for the response. This process is not deep monitored hence declarative process group worked for me.

---

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [July 12, 2025, 5:49pm UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361/5 "2025-07-12T17:49:20Z")

</div>

[@deni](https://community.dynatrace.com/user/90225)&nbsp;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:

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

```

I’m expecting to see below command line argument:

```markup
python service.py -m PROCESS1 -i 0123

```

Following is the rule applied for&nbsp; **PYTHON-PROCESS1** process group:

```markup
Command line argument $contains(PROCESS1)

```

I tried adding rule with full command line argument but it didn’t worked.

```markup
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&nbsp;separate arguments, which are processed separately

 ![AK_0-1752342408806.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/6/960dc3e4f5d6b10a14012516e991c60090bf4d8f.png)

Also, apart from&nbsp; **PYTHON-PROCESS1** ,&nbsp; **PYTHON-PROCESS2** strangely there is onemore&nbsp;process group with the name **service.py** &nbsp;reported in Dynatrace. For which, the command line argument is appropriate:

```markup
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.&nbsp;For example:- if restart process3 is performed, then command line argument shown for service.py would be:

```markup
python service.py -m PROCESS3 -i 6789

```

[@deni](https://community.dynatrace.com/user/90225)&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;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

---

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [July 15, 2025, 6:48am UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361/6 "2025-07-15T06:48:48Z")

</div>

[@deni](https://community.dynatrace.com/user/90225)&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;any view on above?

---

<div class="post-metadata">

**Author:** ![deni](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/deni/32/163_2.png) [@deni](https://community.dynatrace.com/u/deni)\
**Post date:** [July 15, 2025, 10:32am UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361/7 "2025-07-15T10:32:31Z")

</div>

Hi [@AK](https://community.dynatrace.com/user/2080),

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

---

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [July 25, 2025, 7:27pm UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361/8 "2025-07-25T19:27:27Z")

</div>

[@deni](https://community.dynatrace.com/user/90225)&nbsp;thanks for the useful insights and apologies for not responding to your follow-up question.&nbsp;However, support helped to depart this challenge for me.  
Creating declarative processing rule for each parameter like below worked.

```markup
$eq(python)
$eq(service.py)
$eq(-m)
$eq(PROCESS1)
$eq(-i)
$eq(0123)

```

Note: Order of rule doesn’t matter

Regards,  
AK

---

<div class="post-metadata">

**Author:** ![deni](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/deni/32/163_2.png) [@deni](https://community.dynatrace.com/u/deni)\
**Post date:** [July 26, 2025, 9:59pm UTC](https://community.dynatrace.com/t/process-group-detection-rule/52361/9 "2025-07-26T21:59:36Z")

</div>

Hi&nbsp;[@AK](https://community.dynatrace.com/user/2080)&nbsp;,

I’m happy that you have the solution,&nbsp; but can you please answer my questions? Yes, I’m trying to help, but also learning 🙂&nbsp; And I’m still wondering is this the only one solution? Is this solution optimal? - I’m asking myself questions like this, so I will appreciate if you find some time for a little bit more details about the usecase.  
Thanks!

Regards, Deni
