Exploring exporter metrics
All the exporters we deployed expose metrics in Prometheus format. We can observe them by sending a simple HTTP request. Since the services do not publish any ports, the only way we can communicate with them is through the monitor
network attached to those exporters.
We'll create a new utility service and attach it to the monitor
network.
docker service create \ --name util \ --network monitor \ --mode global \ alpine sleep 100000000
We created a service based on the alpine
image, named it util
, and attached it to the monitor
network so that it can communicate with exporters we deployed. We made the service global
so that it runs on every node. That guaranteed that a replica runs on the node we're in. Since alpine
does not have a long running process, without sleep
, it would stop as soon as it started, Swarm would reschedule it, only to detect that it stopped again, and so on. Without sleep
it would enter a never ending loop of failures and...