# PRO TIP - Step by Step guide to set (much the same as) Host Groups in Fargate

**URL:** <https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798>\
**Category:** Dynatrace Tips\
**Tags:** aws, container, process-groups, tips-and-tricks, docker\
**Created:** [May 17, 2023, 10:04pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798 "2023-05-17T22:04:15Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [May 17, 2023, 10:04pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/1 "2023-05-17T22:04:15Z")

</div>

If you want to monitor AWS [Fargate](https://docs.aws.amazon.com/AmazonECS/latest/userguide/what-is-fargate.html) with Dynatrace and [deploy OneAgent](https://www.dynatrace.com/support/help/shortlink/aws-fargate) you have three options according to your scenario:

- [Automatic Injection](https://www.dynatrace.com/support/help/shortlink/aws-fargate#autoinjection)
- [Build-time Injection](https://www.dynatrace.com/support/help/shortlink/aws-fargate#buildtime)
- [Runtime Injection](https://www.dynatrace.com/support/help/shortlink/aws-fargate#runtime)

As you may notice the parameter:

```auto
<font size="4">--set-host-group=my_host_group</font>

```

is not supported in Fargate but for many of us this is a gruesome headache because we use hosts groups for many purposes like assigning membership to MZ’s among others.

But the following guide is a step by step solution to resolve this using a workaround.

1. No matter what option you selected to create the container please add an [Enviroment Variable in your dockerfile](https://docs.docker.com/engine/reference/builder/#environment-replacement).

```c
ENV DT_CUSTOM_PROP "Host_Group=AWS-EKS-FARGATE-SWITCH"​

```

example:

 ![DanielS_0-1684356213649.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/e840bff8fd34108ce4ecf8f6ead13b7570ac485c.png)

- As you see in STEP 1 after **ENV** use [**DT\_CUSTOM\_PROP**](https://www.dynatrace.com/support/help/shortlink/process-group-properties#variables)

- And finally set your Environment Metadata “Host\_Group=my\_host\_group” in my example “HOST\_GROUP=AWS-EKS-FARGATE-SWITCH”

- After this please deploy your Fargate container.

- If everything goes as expected you will be able to see the Environment custom metadata on your process group

- Well so far so good, now it’s time to add an autotagging rule as follows:

- Well after this your Host(Container),Process Group, Process Group Instances and Services will have the tag from the rule of your (much the same as)“Host\_Group” Environment custom metadata.

- Feel free to add these entities to your MZ.

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

My main inspiration for writing this PRO TIP is to create a guide based on ideas I saw in another post. This is the guide I wish I had found in the first place for this topic. Using that solution as a base I had to sort and test ideas and adapt to the new interface, I want to thank to [@abraham\_villega](https://community.dynatrace.com/user/34281) original answer on that [post.](https://community.dynatrace.com/post/175729) and to my fellow :dynamight: Jason [@ct\_27](https://community.dynatrace.com/user/38037) for contacting me, you were the trigger to start writing.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [May 30, 2023, 12:42pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/2 "2023-05-30T12:42:44Z")

</div>

Bookmarked for sure! Thanks&nbsp;[@DanielS](https://community.dynatrace.com/user/35788)&nbsp;for sharing this 🙂

---

<div class="post-metadata">

**Author:** ![Kenny\_Gillette](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kenny_gillette/32/20170_2.png) [@Kenny\_Gillette](https://community.dynatrace.com/u/Kenny_Gillette)\
**Post date:** [June 12, 2023, 12:12pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/3 "2023-06-12T12:12:25Z")

</div>

also, can they use the native AWS HostGroup tag too?

---

<div class="post-metadata">

**Author:** ![tluong](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@tluong](https://community.dynatrace.com/u/tluong)\
**Post date:** [August 5, 2024, 5:53pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/4 "2024-08-05T17:53:35Z")

</div>

I have spent the last few days on this config alone. Thank you so much for posting this!!

---

<div class="post-metadata">

**Author:** ![agravier](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agravier/32/29303_2.png) [@agravier](https://community.dynatrace.com/u/agravier)\
**Post date:** [October 11, 2024, 10:40am UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/5 "2024-10-11T10:40:13Z")

</div>

Thank you&nbsp;[@DanielS](https://community.dynatrace.com/user/35788), You totally brightened my day!  
See U soon !

---

<div class="post-metadata">

**Author:** ![jkt10](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@jkt10](https://community.dynatrace.com/u/jkt10)\
**Post date:** [February 18, 2025, 12:09am UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/6 "2025-02-18T00:09:35Z")

</div>

Hello Daniel,

I had tried to replicate this both by setting the environment variables as you had here both directly in the Dockerfile, and through the task definition for the container in AWS.

I was wondering if this approach worked with ECS on Fargate, or if this only worked with Kubernetes/EKS on Fargate?

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [February 19, 2025, 1:58pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/7 "2025-02-19T13:58:46Z")

</div>

Hello [@jkt10](https://community.dynatrace.com/user/75693) I used this approach on both ECS and EKS on Fargate.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [July 11, 2025, 8:27pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/8 "2025-07-11T20:27:29Z")

</div>

Hi&nbsp;[@DanielS](https://community.dynatrace.com/user/35788)&nbsp;, first of, gracias por tu solución!!

But I am facing an issue… We have some containers that perform similar tasks, with the same kind of process, but for different apps, that are build for different purposes.

So we have added the "ENV DT\_CUSTOM\_PROP “Host\_Group=APP01” for one app, and "ENV DT\_CUSTOM\_PROP “Host\_Name=APP02” for a second app.

We can see the custom metadata at the process instance entity as it should be, APP01 for one and APP02 for other. But since they don’t have a hostgroup and the process are the same tech/version, they have the same ProcessGroup, and at the PG entity, it have a random value for the custom metada, and the Autotag rule ends up getting the wrong value.

Setting different metadata Key also don’t solve this issue, since the PG ends up with all the custom metadata, and again the auto tag rule gets the wrong value, in fact, it gets all of them.

Do you faced this same behavior at your side?

Any idea on how to sort this out?

The idea is to easy find the respective app at the service list.

Thanks.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [July 15, 2025, 3:49pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/9 "2025-07-15T15:49:57Z")

</div>

Hello&nbsp;[@dannemca](https://community.dynatrace.com/user/18264)&nbsp;I’m happy to help, mi amigo.

Look at the following config under Process Group Naming:

 ![DanielS_0-1752531239454.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/3/f3673a97b5f1ad3b2145339ffd4c5535ce06b796.png)

Do you think&nbsp; it could help you? Pls, let me know.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [July 23, 2025, 5:37pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/10 "2025-07-23T17:37:07Z")

</div>

That will just rename the PG, but it will not define the grouping. I tried to create a simple detection rule too, using the custom env as identifier, but it did not worked…

I am trying with support chat for support on this.

Some of my containers are not getting the default AWS properties during the oneagent start, and this is causing the messing with the process grouping.

Gracias, amigo.

edit: I forgot to mention that I could sort out the auto tagging issue, using the entity selector with from/to relationship, since the process instance are getting the right tag based on the custom metadata value.

---

<div class="post-metadata">

**Author:** ![sqnocopsguy](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sqnocopsguy](https://community.dynatrace.com/u/sqnocopsguy)\
**Post date:** [September 2, 2026, 4:45pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/11 "2026-09-02T16:45:15Z")

</div>

[@DanielS](https://community.dynatrace.com/user/35788)&nbsp;would you mind replacing the screenshots with larger resolution images? I’m unable to read them. I zoomed in, as well as opened the image in a new tab and zoomed in, but the low resolution/pixel count makes it difficult to make out all of the details that you’ve provided. Thank you in advance.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [September 7, 2026, 10:10pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/12 "2026-09-07T22:10:24Z")

</div>

Hello. Edited, set up the images in Large Mode. Please, let me know if it works for you now&nbsp;[@sqnocopsguy](https://community.dynatrace.com/user/87269)

![Don't Forget to...](https://global.discourse-cdn.com/dynatrace/original/3X/a/6/a6f115daa82fdd229b5f574ad9fd6fb3d98e0a84.gif)

---

<div class="post-metadata">

**Author:** ![sqnocopsguy](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sqnocopsguy](https://community.dynatrace.com/u/sqnocopsguy)\
**Post date:** [September 14, 2026, 5:19pm UTC](https://community.dynatrace.com/t/pro-tip-step-by-step-guide-to-set-much-the-same-as-host-groups-in-fargate/39798/13 "2026-09-14T17:19:38Z")

</div>

yes, much better. thanks!
