Add a Capella Cluster to a Prometheus Server
- Capella Operational
Connect a Prometheus server to your Couchbase Capella cluster and collect metrics.
Each Capella cluster contains a native Prometheus target enabling you to connect to Prometheus metrics. You can collect metrics in Capella using HTTP Service Discovery.
Use the following procedure to add a Capella cluster to your Prometheus server, and use a sample configuration file to start collecting metrics.
Prerequisites
You need the following prerequisites for each Capella cluster that you want to collect metrics from:
-
Copy the Public Connection String to specify the Capella cluster endpoint for your client connection. For more information, see Connect To Your Cluster.
-
Create or get cluster access credentials with Read access to all buckets and scopes in your cluster. For more information, see Configure Cluster Credentials.
-
Download the security certificate for your cluster and copy it into your Prometheus directory. For more information, see Download the Security Certificate.
-
Add a list of allowed IP addresses for your cluster. For more information, see Configure Allowed IP Addresses.
-
Have a Prometheus server running. For more information, see Collecting Cluster Metrics Blog and Configure Prometheus to Collect Couchbase Metrics.
Define Collection Metrics Configuration
To define a collection metrics configuration:
-
Create a collection configuration file in your Prometheus directory.
For more information, see the Collecting Cluster Metrics Blog and Configure Prometheus to Collect Couchbase Metrics.
| To collect metrics over a private endpoint, see Enable Metrics over Private Endpoints. |
Use the Sample Configuration File
To start collecting metrics, use the following sample configuration file:
- job_name: "capella-plmvshfqolmyxvpt"
basic_auth:
username: "metrics_user"
password: "metrics_Passw0rd"
tls_config:
ca_file: "certs/couchbase-cloud-root-certificate.pem"
scheme: https
http_sd_configs:
- url: https://<public-connection-string>:18091/prometheus_sd_config
basic_auth:
username: "metrics_user"
password: "metrics_Passw0rd"
tls_config:
ca_file: "certs/couchbase-cloud-root-certificate.pem"
The sample configuration file contains the following information:
| Field | Description |
|---|---|
|
Job name to collect metrics. This is the name Prometheus assigns to the process retrieving data from the target nodes. |
|
Cluster username. |
|
Password of the cluster user. |
|
Cluster security certificate. |
|
Protocol scheme to configure requests. |
|
Concatenation of the Public Connection String, REST API, and REST endpoint. |
Collect Metrics over Private Endpoints
| Collecting Prometheus metrics over private endpoints is only available upon request from Capella Support. To open a Support ticket, see Create a Support Ticket. |
To collect metrics over a private endpoint connection, your cluster’s configuration must meet specific requirements. If your configurations do not meet the requirements, use VPC Peering.
Collecting metrics over a private endpoint is only available with the following conditions:
| Supported Clusters | Additional Requirements |
|---|---|
Clusters deployed on AWS |
|
Clusters deployed on GCP |
There are no additional requirements for GCP clusters. |
[1] Enabling both 1:1 Query mapping and metrics requires the Data and Query Services to have dedicated listeners on each node, which reduces the number of nodes you can have to 13. For more information, contact Capella Support.
Enable Private Endpoints for Metrics
To enable private endpoints for Prometheus metrics:
-
Enable metrics with the Management REST API.
-
If you’re enabling the private endpoint service for the first time, use the
POST v4/organizations/{organizationId}/projects/{projectIs}/clusters/{clusterId}/privateEndpointServiceendpoint. -
If you want to enable metrics after enabling the private endpoint service, use the
PUT /v4/organizations/{organizationId}/projects/{projectId}/clusters/{clusterId}/privateEndpointServiceendpoint.
-
-
In your Prometheus directory, set the URL in your configuration file as the concatenation of the Private Endpoint DNS URL, REST API, and Prometheus service discovery endpoint. For example:
https://<private-endpoint-DNS-URL>:18091/prometheus_sd_config?network=external