Skip to content

Instantly share code, notes, and snippets.

@areed
Created January 12, 2018 21:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save areed/6cd21719e3b2280b9fba042c91ee1adc to your computer and use it in GitHub Desktop.
Save areed/6cd21719e3b2280b9fba042c91ee1adc to your computer and use it in GitHub Desktop.
Check the application's processor service and the statsd service are both in the same overlay network.
```
docker service inspect processor
```
Then look under the `Networks` section to see all the networks each service is attached to.
If both services are in the same network, check for DNS or network issues.
```
docker exec -it processor bash
apt-get update
apt-get install dnsutils curl
dig statsd_replicated
# should show the service's virtual IP address (load balancer IP)
curl -k -v https://statsd:2443
# should show the connection to graphite could be made
```
The command to check for all metrics reported to graphite is `curl -k https://statsd:2443/metrics/index.json`.
This could be run from processor since it had a shell.
Sometimes your application containers don't have a shell, but you can run an arbitrary container attached to the network you're debugging.
```
docker service create --name debug --network statsd debian:9 bash -c 'sleep infintiy'
```
Then do `docker ps` find the container, exec in, and install whatever utils you need, like shown above with processor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment