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

If you want to monitor AWS Fargate with Dynatrace and deploy OneAgent you have three options according to your scenario:

As you may notice the parameter:

<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.
ENV DT_CUSTOM_PROP "Host_Group=AWS-EKS-FARGATE-SWITCH"​

example:

  • As you see in STEP 1 after ENV use DT_CUSTOM_PROP

  • 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:

    Please pay attention to the options on the numbers 1 to 8.

  • 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 original answer on that post. and to my fellow :dynamight: Jason @ct_27 for contacting me, you were the trigger to start writing.

24 Likes

Bookmarked for sure! Thanks @DanielS for sharing this :slightly_smiling_face:

2 Likes

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

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

2 Likes

Thank you @DanielS, You totally brightened my day!
See U soon !

2 Likes

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?

1 Like

Hello @jkt10 I used this approach on both ECS and EKS on Fargate.

2 Likes

Hi @DanielS , 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.

2 Likes

Hello @dannemca I’m happy to help, mi amigo.

Look at the following config under Process Group Naming:

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

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.

1 Like

@DanielS 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.

1 Like

Hello. Edited, set up the images in Large Mode. Please, let me know if it works for you now @sqnocopsguy

Don't Forget to...

yes, much better. thanks!