Visualizing metrics with Grafana

The expression browser has a built-in graph panel that enables us to see the metrics, but it's not designed to serve as a visualization dashboard for daily routines. Grafana is the best option for Prometheus. We discussed how to set up Grafana in Chapter 4, Managing Stateful Workloads, and we also provided templates in the repository for this chapter.

To see Prometheus metrics in Grafana, we first have to add a data source. The following configurations are required to connect to our Prometheus server:

  • Type: Prometheus
  • URL: http://prometheus-svc.monitoring:9090

Once it's connected, we can import a dashboard. On Grafana's sharing page (https://grafana.com/dashboards?dataSource=prometheus), we can find rich off-the-shelf dashboards. The following screenshot is from dashboard #1621:

Because the graphs are drawn by data from Prometheus, we are capable of plotting any data we want, as long as we master PromQL.

The content of a dashboard might vary significantly as every application focuses on different things. It is not a good idea, however, to put everything into one huge dashboard. The USE method (http://www.brendangregg.com/usemethod.html) and the four golden signals (https://landing.google.com/sre/book/chapters/monitoring-distributed-systems.html) provide a good start for building a monitoring dashboard.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset