Exporting Metrics in Prometheus Format

You can export metrics in Prometheus format and then customize monitoring and alerts for database clusters yourself.

MySQL and PostgreSQL metrics that are available in the Control panel, are supported.

Historical information for clusters is not available — metrics are only queried in real time.

Add Metrics

To export metrics, you need to get a monitoring token. The token provides you with access to the metrics of all clusters in the same project pool.

  1. From the Control panel, go to the Cloud platform ⟶ Managed Databases section.
  2. Click Tokens for Prometheus ⟶ Create.
  3. Enter a token name. The token will be generated automatically. Click Create.
  4. Add the following to the Prometheus configuration file:
scrape_configs:
  - job_name: get-metrics-from-dbaas
    scrape_interval: 1m
    static_configs:
      - targets:
        - '<region>.dbaas.selcloud.ru'
    scheme: https
    authorization:
      type: Bearer
      credentials: <monitoring_token>
Specify:

- `<region>` — pool where the token is operating, for example `ru-3`;
- `<monitoring_token>` — monitoring token value.
  1. The source of the metrics will appear at http://localhost:9090/targets. Specify localhost — the IP address where Prometheus is installed.