Querying metrics
Targets are up and running, and Prometheus is scraping their data. We should generate some traffic that would let us see Prometheus query language in action.
We'll deploy go-demo
stack. It contains a service with an API and a corresponding database. We'll use it as a demo service that will allow us to explore better some of the metrics we can use.
docker stack deploy \
-c stacks/go-demo.yml \
go-demo
We should wait a few moments for the services from the go-demo
stack to start running. Please execute docker stack ps go-demo
to confirm that all the replicas are running.
Now that the demo service is running, we can explore some of the metrics we have at our disposal by opening graph page.
open "http://$(docker-machine ip swarm-1)/monitor/graph"
Please type haproxy_backend_connections_total
in the Expression
field, and press the Execute
button. The result should be zero connections on the backend go-demo_main-be8080
. Let's spice it up by creating a bit of traffic:
for...