---
title: "Prometheus Exporter for Cloud Databases | Hostman Docs"
description: "Learn how to configure Prometheus Exporter to collect metrics for DBaaS clusters (MySQL, PostgreSQL, Valkey, etc.) in Hostman. Setup and config examples."
---

> For the complete documentation index for AI agents, see [llms.txt](https://hostman.com/llms.txt).

The Prometheus Exporter is a component that collects metrics from the operating system and databases and provides them in a format that Prometheus understands. The exporter helps monitor the state of database clusters, server load, and other important real-time information.

## Exporter Setup

Exporter access details are available on the cluster page in the **Dashboard** tab.

![Exporter](https://content.hostman.com/assets/44eabc12-b3e5-4a9d-8c27-27f67a8dbd93.png?width=776&height=618)

When using public exporters, access to metrics requires basic authentication.

Example request to a public exporter:

```shell
curl -u admin:'password' -s https://dbs-exporter.hostman.com/exporter_id/service/metrics
```

## Limitations

-   Metric collection is available **only in BGP networks** (Germany and the Netherlands).
-   Exporters are available on two endpoints:
    

-   `:9100`: Server metrics (e.g., load, CPU, and memory usage);
    
-   `:9308`: Database metrics.
    

## Exporter Types

There are two types of exporters:

-   **Public exporters** are exposed over HTTPS and accessible via a domain name.
-   **Private exporters** are accessible only within a private BGP network.

|  | **Public exporters** | **Private exporters** |
| --- | --- | --- |
| **Metric Access** | Via domain name | Via IP address within the private network |
| **Public IP required** | No | No |
| **Authentication** | Basic Auth | Not required |

## Exporters Used

| **DBaaS Cluster** | **Exporter** |
| --- | --- |
| MySQL | [MySQL Server Exporter](https://github.com/prometheus/mysqld_exporter) |
| PostgreSQL | [PostgreSQL Server Exporter](https://github.com/prometheus-community/postgres_exporter) |
| RabbitMQ | [RabbitMQ Exporter](https://github.com/kbudde/rabbitmq_exporter) |
| Valkey | [Prometheus Valkey & Redis Metrics Exporter](https://github.com/oliver006/redis_exporter) |
| Kafka | [JMX Exporter](https://github.com/prometheus/jmx_exporter) |
| OpenSearch | [Prometheus Exporter Plugin for OpenSearch](https://github.com/opensearch-project/opensearch-prometheus-exporter) |
| ClickHouse | [Built-in Exporter](https://clickhouse.com/docs/interfaces/formats/Prometheus) |

### Checking Exporter Version

To find the version of a specific exporter, use the command:

```shell
curl -s http://private_IP:9308/metrics | grep '_exporter_build_info'
```

You’ll receive output similar to:

```shell
# HELP postgres_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which postgres_exporter was built, and the goos and goarch for the build.

# TYPE postgres_exporter_build_info gauge

postgres_exporter_build_info{branch="HEAD",goarch="amd64",goos="linux",goversion="go1.23.3",revision="a324fe37bca5193a293118b940b3df7ab3a8505c",tags="unknown",version="0.16.0"} 1
```

The value `version="0.16.0"` indicates the exporter version.

**Note:** The OpenSearch exporter is built manually, so it is not possible to determine its version using this command.

## Example Configuration

Let’s look at configuring Prometheus on a cloud server to collect metrics from a PostgreSQL cluster.

#### 1\. Ensure Network Connectivity

Make sure that the database cluster and the cloud server are in the same private network.

#### 2\. Install Prometheus

Go to the [Prometheus releases page](https://github.com/prometheus/prometheus/releases) and download the latest version. For example:

```shell
wget https://github.com/prometheus/prometheus/releases/download/v3.7.2/prometheus-3.7.2.linux-amd64.tar.gz
```

Extract the archive:

```shell
tar -xzf prometheus-*.tar.gz
```

Navigate to the directory:

```shell
cd prometheus-3.7.2.linux-amd64
```

#### 3\. Configure Prometheus

Open the configuration file:

```shell
nano prometheus.yml
```

Add the database cluster’s private IP address and ports to the `scrape_configs` section:

```yaml
- job_name: 'linux-metrics'
  static_configs:
    - targets: ['192.168.0.5:9100']

- job_name: 'postgres-metrics'
  static_configs:
    - targets: ['192.168.0.5:9308']
```

Here, `192.168.0.5` is the private IP of the PostgreSQL cluster.

When using a **public exporter**, the scrape configuration looks as follows:

```yaml
- job_name: 'postgres-public'
  scheme: https
  metrics_path: /exporter_id/service/metrics
  static_configs:
    - targets: ['dbs-exporter.hostman.com']
  basic_auth:
    username: 'admin'
    password: 'password'
```

To collect **server metrics**, use `/exporter_id/node-exporter/metrics` instead of `/exporter_id/service/metrics`.

Full configuration example:

```yaml
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: "prometheus"

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ["localhost:9090"]
       # The label name is added as a label `label_name=<label_value>` to any timeseries scraped from this config.
        labels:
          app: "prometheus"
  - job_name: 'linux-metrics'
    static_configs:
      - targets: ['192.168.0.5:9100']

  - job_name: 'postgres-metrics'
    static_configs:
      - targets: ['192.168.0.5:9308']

  - job_name: 'postgres-public'
    scheme: https
    metrics_path: /exporter_id/service/metrics
    static_configs:
      - targets: ['dbs-exporter.hostman.com']
    basic_auth:
      username: 'admin'
      password: 'password'
```

#### 4\. Start Prometheus

Run Prometheus with the specified configuration file:

```shell
./prometheus --config.file=prometheus.yml
```

By default, the Prometheus web interface will be available at:

```shell
http://<cloud_server_IP>:9090
```

#### 5\. Check Exporter Status

In the Prometheus web interface, go to **Status** → **Targets**.

Make sure that all `job_name` entries are visible and have the status **UP**.

For a basic check, you can run the following query on the **Graph** tab:

```shell
up
```

If everything is working correctly, you’ll see all connected exporters listed with their corresponding `job_name` values.

![Aef4c1cb 737e 4414 82fd C9acc0500161.png](https://content.hostman.com/assets/1c00f8ab-49b3-4aa6-8b97-dedccbd35b79.png?width=2610&height=1434)

_List of metrics in the [Prometheus](https://prometheus.io/) interface_
