Grafana is used as a visualizer for metrics as graphs, tables, and so on. However, the data that is needed to visualize this information needs to be made available through a data source. This data source should contain all the time series diagnostic data of a PostgreSQL server. In this recipe, we shall discuss Prometheus, which is one of the famous data sources. We can use a simple query language called PromQL (Prometheus Query Language) to fetch the time series data stored in Prometheus. These queries will be used in panels on a Grafana dashboard to visualize the diagnostic data as graphs. We will now see the steps involved in installing and configuring Prometheus.
Getting ready
Prometheus can be installed on the same server as the Grafana server or another remote server. We need to make sure that we have sufficient storage available to store the time series data of all targets being monitored based on the data retention configured...