I have some services (say alpha, bravo and charlie, all of which are Spring boot) running in my ECS cluster as separate services. I also have deployed a service that runs Datadog agent, named dd-agent with AWS Service Discovery enabled. The service dd-agent exposes ports 8125 and 8126 (the standard ports). I can see in the service configuration that the DNS endpoint is dd-agent.ns.com.
I have started alpha with the Datadog trace agent, with the value http://dd-agent.ns.com:8126 as the URL for management.metrics.export.datadog in the application.yml. I can see that this has been picker up correctly by the trace agent as I see an error log.
[dd.trace 2023-10-11 15:41:10:509 +0000] [OkHttp http://dd-agent.ns.com:8126/...] WARN com.datadog.profiling.uploader.ProfileUploader - Failed to upload profile to http://dd-agent.ns.com:8126/profiling/v1/input java.net.SocketException: Connection reset (Will not log errors for 5 minutes)
By the looks of it, it seems like the name resolution doesn't happen. Can someone please take a look and see if I have missed out anything?