For AI agents: the complete documentation index is available at https://docs.ovhcloud.com/pl/llms.txt, the full documentation bundle is available at https://docs.ovhcloud.com/pl/llms-full.txt, and this page is available as Markdown at https://docs.ovhcloud.com/pl/guides/public-cloud/databases/service-metrics-with-prometheus.md.
Przejdź do treści

Fetch service metrics with Prometheus for Public Cloud Databases

Pokaż jako Markdown

Find out how to setup a Prometheus exporter for your Public Cloud databases service

Objective

Public Cloud databases allow you to export service metrics using Prometheus.

This guide explains how to setup a Prometheus exporter for your Public Cloud databases service so that a Prometheus server can collect metrics.

Requirements

Instructions

Enable the Prometheus exporter for your service

Via the OVHcloud Console
Via the OVHcloud API

In the left-hand menu of your Public Cloud project, click your engine under Databases, then click the name of your service.

Open the Configuration tab and locate the Prometheus integration section (the Configure link of the Prometheus block in the Observability tab leads to the same place). Click Enable Prometheus.

Enabling it may take a few minutes. Once ready, the credentials and endpoint appear in the section.

To stop the exporter later, click Disable Prometheus in the same section, then Confirm.

Retrieve the Prometheus exporter access info

Via the OVHcloud Console
Via the OVHcloud API

In the Prometheus integration section of the Configuration tab, copy the access information:

  • Username;
  • for MongoDB, the SRV domain, which resolves to the nodes of the cluster;
  • for the other engines, the Host and Port of each node: when the cluster has several nodes, select the node in the Prometheus target list to display its host and port.

To obtain the password, click Reset password, then Confirm. A new password is generated and the current one stops working immediately. Copy it right away: it cannot be shown again.

Configure your Prometheus server and start pulling metrics

Use the data from the previous state to configure your Prometheus server and start pulling metrics for your service. Here is an example of such a Prometheus configuration for a MongoDB service:

scrape_configs:
- job_name: mongo-metrics
  scrape_interval: 10s
  metrics_path: /metrics
  scheme : https
  basic_auth:
    username: prometheus
    password: "xxx"
  dns_sd_configs:
    - names:
      - '_prometheus._tcp.mongodb-7bfb5d40-oa85dff3e.database.cloud.ovh.net' 

The other engines use a slightly different format:

scrape_configs:
- job_name: postgresql-metrics
  scrape_interval: 10s
  metrics_path: /metrics
  scheme : https
  basic_auth:
    username: prometheus
    password: "xxx"
  tls_config:
      insecure_skip_verify: true
  static_configs:
    - targets: 
        - postgresql-02d6a757-ovh-dev.database.cloud.ovh.net:9273
        - replica-postgresql-02d6a757-ovh-dev.database.cloud.ovh.net:9273

Limitations

Public Cloud Databases offer service metrics via Prometheus for the following engines:

  • Valkey
  • MongoDB
  • MySQL
  • PostgreSQL

Prometheus endpoints are subject to the same networking limitations the associated service is. Thus, IP restrictions apply, and for services using private networking, the Prometheus exporter endpoint is only reachable from the private network your service is attached to.

We want your feedback!

We would love to help answer questions and appreciate any feedback you may have.

For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.

Are you on Discord? Connect to our channel at https://discord.gg/ovhcloud and interact directly with the team that builds our databases service!

Czy ta strona była pomocna?