<!-- review: finished -->

<a id="grafana"></a>

# Configuring the Prometheus dashboard

To configure the [Prometheus dashboard for Angie](https://grafana.com/grafana/dashboards/20719-angie-dashboard/) in Grafana,
follow these steps:

1. Using the [Prometheus](https://en.angie.software//angie/docs/configuration/modules/http/http_prometheus.md#http-prometheus) module,
   add the following [include](https://en.angie.software//angie/docs/configuration/modules/core.md#include) directive in the `http` block
   of the [configuration file](https://en.angie.software//angie/docs/configuration/configfile.md#configfile):
   ```nginx
   http {
       include prometheus_all.conf;

       # ...
   }
   ```

   Also add the corresponding [prometheus](https://en.angie.software//angie/docs/configuration/modules/http/http_prometheus.md#id1) directive
   inside a `location` within a separate `server` block
   with a dedicated IP address and port for this purpose, for example:
   ```nginx
   server {

       listen 192.168.1.100:80;

       location =/p8s {
           prometheus all;
       }

       # ...

   }
   ```

   These enable the export of Angie metrics in Prometheus format
   at the endpoint specified in the `location`.
2. Add the following configuration to Prometheus,
   specifying the IP address and port set earlier in the `server`:
   ```yaml
   scrape_configs:
     - job_name: "angie"
       scrape_interval: 15s
       metrics_path: "/p8s"
       static_configs:
         - targets: ["192.168.1.100:80"]
   ```

   This will collect metrics every 15 seconds,
   using the `/p8s` path configured in the previous step.

   #### NOTE
   Make sure the global `scrape_interval` value
   does not exceed the value specified here.
3. Import the [Prometheus dashboard for Angie](https://grafana.com/grafana/dashboards/20719-angie-dashboard/)
   into Grafana.
