> ## Documentation Index
> Fetch the complete documentation index at: https://blockscout-vb-sourcify-migrate-to-api-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Metrics

## Prometheus

BlockScout is setup to export [Prometheus](https://prometheus.io/) metrics at `/metrics`.

1. Install prometheus: `brew install prometheus`
2. Start the web server `iex -S mix phx.server`
3. Start prometheus: `prometheus --config.file=prometheus.yml`

## Grafana

The Grafana dashboard may also be used for metrics display.

1. Install grafana: `brew install grafana`

2. Install Pie Chart panel plugin: `grafana-cli plugins install grafana-piechart-panel`

3. Start grafana: `brew services start grafana`

4. Add Prometheus as a Data Source

   a. `open http://localhost:3000/datasources`

   b. Click "+ Add data source"

   c. Put "Prometheus" for "Name"

   d. Change "Type" to "Prometheus"

   e. Set "URL" to "[http://localhost:9090](http://localhost:9090)"

   f. Set "Scrape Interval" to "10s"

5. Add the dashboards from [https://github.com/deadtrickster/beam-dashboards](https://github.com/deadtrickster/beam-dashboards): For each `*.json` file in the repo.

   a. `open http://localhost:3000/dashboard/import`

   b. Copy the contents of the JSON file in the "Or paste JSON" entry

   c. Click "Load"

6. View the dashboards. (You will need to click-around and use BlockScout for the web-related metrics to show up.)

Examples of dashboards:

<Frame caption="">
  <img src="https://mintcdn.com/blockscout-vb-sourcify-migrate-to-api-v2/-LubF9xiBMPdd24N/images/1954a0f5-image.jpeg?fit=max&auto=format&n=-LubF9xiBMPdd24N&q=85&s=0cd7dc42cdcf01a72d0f24d00d9f626e" width="1376" height="1169" data-path="images/1954a0f5-image.jpeg" />
</Frame>

<Frame caption="">
  <img src="https://mintcdn.com/blockscout-vb-sourcify-migrate-to-api-v2/tXdUT0vYV9y_RBYl/images/a5ae511c-image.jpeg?fit=max&auto=format&n=tXdUT0vYV9y_RBYl&q=85&s=732a08a4e298a9160024d87844b34665" width="1376" height="1169" data-path="images/a5ae511c-image.jpeg" />
</Frame>

<Frame caption="">
  <img src="https://mintcdn.com/blockscout-vb-sourcify-migrate-to-api-v2/POJpCSdBm8sZl4vQ/images/d8d70978-image.jpeg?fit=max&auto=format&n=POJpCSdBm8sZl4vQ&q=85&s=00d8ccfb041fa136f754819649d2ba00" width="1376" height="1169" data-path="images/d8d70978-image.jpeg" />
</Frame>
