# Dynatrace for ECS Fargate shows only one task at same time

**URL:** <https://community.dynatrace.com/t/dynatrace-for-ecs-fargate-shows-only-one-task-at-same-time/38933>\
**Category:** Cloud platforms\
**Tags:** aws\
**Created:** [March 21, 2023, 6:30pm UTC](https://community.dynatrace.com/t/dynatrace-for-ecs-fargate-shows-only-one-task-at-same-time/38933 "2023-03-21T18:30:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SergioB](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SergioB](https://community.dynatrace.com/u/SergioB)\
**Post date:** [March 21, 2023, 6:30pm UTC](https://community.dynatrace.com/t/dynatrace-for-ecs-fargate-shows-only-one-task-at-same-time/38933/1 "2023-03-21T18:30:52Z")

</div>

Hello community, I am recently with the task of deploying the Dynatrace agent in containers running on ECS Fargate with Gitlab. This installation task was done prior to the build of the image in a CICD stage. All this seems to work fine but the problem is that I don’t see in Dynatrace the correct task number scaling, i.e. I see the first container but not additional ones if I scale in quantity.&nbsp;If I replace the displayed task with a new one, stopping the container, the Host displayed by Dynatrace is the new container. In the process group there is only one host.

script:  
# Dynatrace  
- DT\_HOME=dynatrace  
- mkdir -p “$DT\_HOME”  
- wget -O “$DT\_HOME/oneagent.zip” “$DT\_API\_URL/v1/deployment/installer/agent/unix/paas/latest?Api-Token=$DT\_API\_TOKEN&$DT\_ONEAGENT\_OPTIONS”  
- unzip -d “$DT\_HOME” “$DT\_HOME/oneagent.zip”  
- rm “$DT\_HOME/oneagent.zip”

artifacts:  
paths:  
- ./dynatrace/

HOST(THERE IS ONLY ONE)

OneAgent version 1.259.339.20230228-182655 (NodeJS)  
Architecture x86, 64-bit  
Cloud EC2  
Data center Ashburn, United States  
Hypervisor type AWS Nitro  
Memory limit 512 MB  
PaaS type AWS Fargate  
Physical CPU cores 1

---

<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:** [June 8, 2023, 2:10pm UTC](https://community.dynatrace.com/t/dynatrace-for-ecs-fargate-shows-only-one-task-at-same-time/38933/2 "2023-06-08T14:10:48Z")

</div>

[@SergioB](https://community.dynatrace.com/user/60938)&nbsp;Im not too familiar with the deployments for Fargate. Are you still having this issue?

---

<div class="post-metadata">

**Author:** ![SergioB](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SergioB](https://community.dynatrace.com/u/SergioB)\
**Post date:** [June 8, 2023, 6:29pm UTC](https://community.dynatrace.com/t/dynatrace-for-ecs-fargate-shows-only-one-task-at-same-time/38933/3 "2023-06-08T18:29:12Z")

</div>

Hi Chad

Yes, the issue continues.&nbsp;Together with our internal contact at Dynatrace, we have carried out a series of tests where we have found that the number of hosts does not vary according to the ECS scaling. In addition to that, we verified that the host remains always the same even when replacing containers, we only see a change of ip referring to the new task created, but is the same host ID. A support case was raised for verification.  
Another detail to mention, in our previous PAAS platform this error was not present.

---

<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:** [June 16, 2023, 6:50pm UTC](https://community.dynatrace.com/t/dynatrace-for-ecs-fargate-shows-only-one-task-at-same-time/38933/4 "2023-06-16T18:50:34Z")

</div>

Hi [@SergioB](https://community.dynatrace.com/user/60938) I’ve been investigating your issue. As you indicate this happens when OneAgents are deployed in Fargate, but since they have the same OSI ID, only one shows up in the Front end or WebUI of the tenant when you increase replicas \>=2. For standalone/app-only OneAgents (Fargate), OSI ID is determined by the host name.

_So, is it possible to make the hostname unique from Fargate’s point of view?_

Yes, there is a Dynatrace environment variable called **DT\_HOST\_ID** that could also be used to make these hosts unique. You would just set this where you set other AWS environment variables and make the value unique for each replica.

But you can also try to add it from the DOCKERFILE, try something like this:

```markup
ENTRYPOINT ["sh", "-c","export DT_HOST_ID=XXXYYYZZZ-$RANDOM && java"]

```

Change XXXYYYZZZ to whatever you want.

Let us know how it goes.
