11 Nov 2021 03:23 PM - last edited on 16 Aug 2023 08:36 AM by MaciejNeumann
I have several fargate aws tasks in the environment. None of them have a host group configured. I'm trying to set --set-host-group inside my docker file, to make the deploy/run image with this information, but it's not working.
I made some tests, passing the parameter inside of entrypoint and inside of command (Tasks definition), none of them worked.
I spoke to chat and they told me it is not supported, or because I cannot set the host group of my AWS fargates tasks. Is correct?
If yes, does not have any workaround for this?
Solved! Go to Solution.
11 Nov 2021 04:07 PM
Hi Rodrigo,
Setting host group in this case is not possible because the Oneagent is running in the container and not in full-stack.
We have a workaround that can help. You can use DT_CUSTOM_PROP environment variable to equal your host group. It will show on the processes, then you could use a auto tagging rule to propagate to the hosts.
Hope that helps.
Thanks,
Abraham
11 Nov 2021 04:47 PM
I agree with the solution provided by Abraham, had this issue in the past and the HOST_GROUP/--set-host-group flag was not supported on docker container
Im pretty sure that was listed as one of the limitations in this list but I cannot see it anymore (I'm also talking with docs team to update it) https://www.dynatrace.com/support/help/shortlink/oneagent-docker#limitations
The workaround I used was DT_TAGS and DT_CUSTOM_PROP environment variables
06 Mar 2023 05:33 PM - edited 06 Mar 2023 05:41 PM
Thanks, this is a great solution, I updated the image for tags because change a little.
Also when you choose "Custom metadata" choose the one for Process Group not host.
11 Nov 2021 04:57 PM
Hi guys, thanks for the reply.
Just one more doubt.
Should I pass this parameter as an ARG in my dockerfile, like:
ARG DT_CUSTOM_PROP = "Platform"
Thanks
11 Nov 2021 05:12 PM
Cant remember if ENV or ARG (or if any of those will work), the syntax would be :
ENV DT_CUSTOM_PROP="myCustomProp"
ARG DT_CUSTOM_PROP="myCustomProp"
also you can pass it with key:value format:
DT_CUSTOM_PROP="App=springbootdemo"
and multiple values
DT_CUSTOM_PROP="App=springbootdemo Environment=Dev"
14 Aug 2023 05:04 PM
Hey!
If you pass as ARG does that still work? I can't see how Dynatrace could detect the DT_CUSTOM_PROP values if ARG values are only available at runtime?
I was thinking it would be ENV DT_CUSTOM_PROP but my development team are unsure.
14 Aug 2023 05:30 PM - edited 14 Aug 2023 05:30 PM
Hello @Scott_McMahon please see this post.