Open WTK opened 5 years ago
A temporary workaround i've found is where, when datadog is ran within the same swarm stack+network as your service, you replace %%host%%
with the name of the swarm service, eg. you would use nginx
has the hostname for that basic compose file.
com.datadoghq.ad.instances: '[{"nginx_status_url": "http://nginx:81/nginx_status"}]'
This only works when running a single instance of the service per machine, and when the agent is a global
deployment, but that fits my use case for the time being.
Output of the info page (if this is a bug)
Describe what happened: After running a basic docker swarm that consists of nginx and datadog agent, agent fails to resolve IP address of the nginx service and skips this service. As far as I can tell this isn't specific to nginx, but rather to code resulting in this error https://github.com/DataDog/datadog-agent/blob/fd70e65090d3f88c8208f127ab52a9cd383ce658/pkg/autodiscovery/configresolver/configresolver.go#L164
Relevant logs:
Describe what you expected: Agent should pick up on nginx service, resolve its ip and process docker tags correctly set up.
Steps to reproduce the issue: Using this basic docker-compose.yml file run
docker stack deploy -c docker-compose.yml foo
to start a docker swarm. Agent won't correctly discover nginx service. Do the same without swarm mode, and use docker-compose instead and you're golden - everything works as expected.Additional environment details (Operating System, Cloud provider, etc):