> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/database/how-tos/monitor-a-database.md).

# Monitor a database

Databases publish its metrics through a Prometheus metric exposition file over the internet.

***

At the very bottom of the overview page of your database, you find the address for the monitoring page. Note that this page is also affected by the firewall, hence it can only be reached from the IP addresses that you've allowed. See [Manage access](/products/database/how-tos/manage-access.md) on how to add IP addresses that are allowed to connect.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FTYroUXDpwAAjDoGHqBai%2Fdbaas-monitoring-url.png?alt=media&amp;token=fe7b2a3c-a152-44e1-b7ea-8daa1a2f1496" alt=""><figcaption></figcaption></figure>

The metrics provided by the URL in the **Monitoring** section of the overview page are in a format called *Prometheus metric exposition*. This format can be ingested by tools such as InfluxDB scrapers and Prometheus itself.

Below is a short snippet of the metric data:

{% code title="Example metric" %}

```
# HELP disk_free Telegraf collected metric
# TYPE disk_free gauge
disk_free{device="sda2",fstype="ext4",host="db-4f959",label="",mode="rw",path="/"} 2.5386483712e+10
disk_free{device="tmpfs",fstype="tmpfs",host="db-4f959",label="",mode="rw",path="/dev/shm"} 2.044461056e+09
disk_free{device="tmpfs",fstype="tmpfs",host="db-4f959",label="",mode="rw",path="/run"} 4.078592e+08
disk_free{device="tmpfs",fstype="tmpfs",host="db-4f959",label="",mode="rw",path="/run/lock"} 5.24288e+06
disk_free{device="udev",fstype="devtmpfs",host="db-4f959",label="",mode="rw",path="/dev"} 2.006528e+09
```

{% endcode %}

## Ingesting the database metrics into InfluxDB

To start ingesting metrics into InfluxDB, begin by creating a new bucket. Inside InfluxDB, hover over the up-arrow icon and click **Buckets**.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FSTSgB5tpJmZ9STtZQ0hV%2Fdbaas-influxdb-create-bucket.png?alt=media&amp;token=f5ecff23-ba66-405e-a522-decdd252f744" alt=""><figcaption></figcaption></figure></div>

Now, click **Create bucket**.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FdNX7T2vCtoCz7IQui5uJ%2Fdbaas-influxdb-create-bucket1.png?alt=media&amp;token=1feabd5c-8a00-47e2-b7a6-6968df2d3e8a" alt=""><figcaption></figcaption></figure></div>

In the dialog box that appears, enter a name for the bucket. In this example, we’ll name it *glesys-my-test-db*. Then, click **Create**.

<div align="left"><figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FGk2v3ouNQTdrGjuZsG66%2Fdbaas-influxdb-bucket-test-db.png?alt=media&amp;token=b86e116d-f406-44b9-a17e-d724623e93dc" alt="" width="563"><figcaption></figcaption></figure></div>

Next, click the **Scrapers** tab, then **Create scraper**.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FMJLOTawWTOodTB1cN2WJ%2Fdbaas-influxdb-create-scrapers.png?alt=media&amp;token=81fbad7f-6145-4e5b-8ab4-1a4bcbd297a6" alt=""><figcaption></figcaption></figure>

You need to provide some information for your scraper. In this example, we name the scraper *Glesys scraper my-test-db*. You also need to select where the scraper should store the data—here, choose the bucket you created earlier.

In the **Target URL** field, enter the URL for the metrics. This URL can be found under the **Monitoring** section on the overview page of your database.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2FzqitUoDgi4Ue8Xpd1Zml%2Fdbaas-influxdb-setup-scraper.png?alt=media&amp;token=956b6e84-e69f-48b1-b290-1a7d89969b59" alt=""><figcaption></figcaption></figure>

Everything is now set up and ready. To explore the metrics, click the graph icon to open **Data Explorer**.

To make things easier, toggle **Switch to old Data Explorer**. From here, you can click through the available metrics to visualize them.

First, select the bucket with the data; in this example, it's *glesys-my-test-db*. Then, choose the metrics *disk\_total* and *disk\_used*. In the **Field** column, select *gauge*. In the next column, switch to **path** and select the root path indicated by a forward slash. Finally, click **Submit**.

You can now hover over the graph to see exactly how much storage your database has and how much you've used.

<figure><img src="https://3379166260-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlMZhhdQNcWOpX5Bj48GK%2Fuploads%2F1GRT4HJ7uoNn75dso6lb%2Fdbaas-influxdb-metrics.png?alt=media&amp;token=09dc46ad-16e6-46b8-be6e-ee21dea17ea1" alt=""><figcaption></figcaption></figure>
