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

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

DanielS
DynaMight Guru
DynaMight Guru

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:

--set-host-group=my_host_group

 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:
DanielS_0-1684356213649.png


 

  • 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
    DanielS_1-1684358026432.png

  • Well so far so good, now it's time to add an autotagging rule as follows:
    DanielS_2-1684358289924.png

    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.

 

Dynatrace Certified Professional @ www.dosbyte.com
9 REPLIES 9

ChadTurner
DynaMight Legend
DynaMight Legend

Bookmarked for sure! Thanks @DanielS for sharing this 🙂

-Chad

Kenny_Gillette
DynaMight Leader
DynaMight Leader

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

Dynatrace Certified Professional

tluong
Newcomer

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

AurelienGravier
DynaMight Champion
DynaMight Champion

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

Observability consultant - Dynatrace Associate/Pro/Services certified

jkt10
Visitor

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?

DanielS
DynaMight Guru
DynaMight Guru

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

Dynatrace Certified Professional @ www.dosbyte.com

dannemca
DynaMight Guru
DynaMight Guru

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.

Site Reliability Engineer @ Kyndryl

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

Look at the following config under Process Group Naming:

DanielS_0-1752531239454.png

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

Dynatrace Certified Professional @ www.dosbyte.com

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.

Site Reliability Engineer @ Kyndryl

Featured Posts