How to enable the prometheus mode in Couchbase 7.6 Monitor

How to enable the prometheus mode in Couchbase 7.6 Monitor

Couchbase 7.6 - Prometheus Monitoring Setup

This guide explains how to enable and configure Prometheus monitoring for Couchbase Server 7.6.

Note: From Couchbase 7.0 has built-in Prometheus support. No external exporter is required.

STEP 1 – Verify Couchbase Server

Ensure Couchbase is running and accessible:

http://<HostName>:8091

Login using your Couchbase Administrator credentials.


STEP 2 – Download Prometheus Service Discovery File

Couchbase provides an auto-generated configuration file for Prometheus.

Open in browser:

http://<couchbase-host>:8091/prometheus_sd_config.yaml

Example:

http://<HostName>:8091/prometheus_sd_config.yaml

Or download using command:

wget --content-disposition \
"http://<HostName>:8091/prometheus_sd_config.yaml" \
--http-user Administrator \
--http-password your_password
This file contains all Couchbase nodes and required ports automatically.

STEP 3 – Save the Configuration File

Save the downloaded file in your Prometheus directory:

Windows:
C:\prometheus\couchbase_sd.yaml

Linux:
/opt/prometheus/couchbase_sd.yaml

STEP 4 – Configure Prometheus

Edit the prometheus.yml file:

global:
scrape_interval: 15s

scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']

- job_name: 'couchbase'
file_sd_configs:
- files:
- C:/prometheus/couchbase_sd.yaml
basic_auth:
username: "Administrator"
password: "your_password"
Ensure scrape_configs is defined only once in the file.

STEP 5 – Start / Restart Prometheus

Run Prometheus:

prometheus.exe

Or restart service (Linux):

systemctl restart prometheus

STEP 6 – Verify Metrics

Open Prometheus UI:

http://<HostName>:9090

Go to Targets and verify Couchbase targets are UP.

Test metrics:

kv_ops

STEP 7 – Troubleshooting

Issue: No Targets Found

  • Check file path in prometheus.yml

Issue: Authentication Failure

  • Verify username/password
  • Try login in Couchbase UI