Querying metrics from instrumented services
Let's open the Prometheus graph screen and explore different ways to query metrics scraped from the go-demo_main
service.
open "http://$(docker-machine ip swarm-1)/monitor/graph"
Please click the Graph
tab, enter the query that follows, and click the Execute
button
http_server_resp_time_sum / http_server_resp_time_count
We divided the summary of response times with the count of the requests. You'll notice that the output graph shows that the average value is close to zero. Feel free to hover over one of the lines and observe that the values are only a few milliseconds. The go-demo_main
service pings itself periodically and the responses are very fast.
We should generate some slower responses since the current result does not show metrics in their true glory.
The /demo/hello
endpoint of the service can be supplemented with the delay
parameter. When set to a value in milliseconds, the service will wait for the given period before responding to the request...