Skip to main content

Couchbase

Plugin: go.d.plugin Module: couchbase

Overview

This collector monitors Couchbase servers.

This collector is supported on all platforms.

This collector supports collecting metrics from multiple instances of this integration, including remote instances.

Default Behavior

Auto-Detection

This integration doesn't support auto-detection.

Limits

The default configuration for this integration does not impose any limits on data collection.

Performance Impact

The default configuration for this integration is not expected to impose a significant performance impact on the system.

Metrics

Metrics grouped by scope.

The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.

Per Couchbase instance

These metrics refer to the entire monitored application.

This scope has no labels.

Metrics:

MetricDimensionsUnit
couchbase.bucket_quota_percent_useda dimension per bucketpercentage
couchbase.bucket_ops_per_seca dimension per bucketops/s
couchbase.bucket_disk_fetchesa dimension per bucketfetches
couchbase.bucket_item_counta dimension per bucketitems
couchbase.bucket_disk_used_statsa dimension per bucketbytes
couchbase.bucket_data_useda dimension per bucketbytes
couchbase.bucket_mem_useda dimension per bucketbytes
couchbase.bucket_vb_active_num_non_residenta dimension per bucketitems

Functions

This collector exposes real-time functions for interactive troubleshooting in the Top tab.

Top Queries

Retrieves completed N1QL query statistics from Couchbase system:completed_requests keyspace.

This function queries the system:completed_requests keyspace which stores information about recently completed N1QL requests. It provides timing metrics, result statistics, and error/warning counts for each completed query.

Use cases:

  • Identify slow N1QL queries consuming the most elapsed time
  • Find queries with high error or warning counts
  • Analyze query patterns by user to understand workload distribution

Statement text is truncated at 4096 characters for display purposes.

AspectDescription
NameCouchbase:top-queries
Require Cloudyes
PerformanceQueries system:completed_requests via the N1QL query service:
• The completed_requests keyspace has a configurable size limit (completed-limit setting)
• Default limit of 500 rows balances usefulness with performance
SecurityQuery text may contain unmasked literal values including potentially sensitive data:
• Personal information in WHERE clauses or INSERT values
• Business data embedded in queries
• Access should be restricted to authorized personnel only
AvailabilityAvailable when:
• The collector has successfully connected to Couchbase
• The N1QL (Query) service is running
• Returns HTTP 503 if collector is still initializing
• Returns HTTP 500 if the query fails
• Returns HTTP 504 if the query times out

Prerequisites

Grant access to system:completed_requests

The user must have appropriate privileges to query system keyspaces and the N1QL service must be available.

  1. Ensure the N1QL (Query) service is running on the cluster

  2. Grant query system catalog privileges to the monitoring user:

    GRANT QUERY_SYSTEM_CATALOG TO netdata_user;
  3. Verify access to completed_requests:

    SELECT * FROM system:completed_requests LIMIT 1;
    info
    • The system:completed_requests keyspace stores recently completed queries based on Couchbase server settings completed-limit and completed-threshold
    • Only queries exceeding completed-threshold (default 1000ms) are logged to completed_requests
    • Adjust completed-threshold in Couchbase Query Settings to capture faster queries if needed

Parameters

ParameterTypeDescriptionRequiredDefaultOptions
Filter ByselectSelect the primary sort column. Options include elapsed time, service time, request time, and result count. Defaults to elapsed time to focus on slowest queries.yeselapsedTime

Returns

Completed N1QL request statistics. Each row represents a single completed query with its timing and result metrics.

ColumnTypeUnitVisibilityDescription
Request IDstringhiddenUnique identifier for the N1QL request. Can be used for correlation with Couchbase logs.
Request TimetimestampTimestamp when the request was received by the query service.
StatementstringThe N1QL statement that was executed. Truncated to 4096 characters.
Elapsed TimedurationmillisecondsTotal time from request receipt to response completion, including queue time, planning, execution, and result streaming.
Service TimedurationmillisecondsTime spent actively processing the request, excluding network latency and queue wait time. Compare with elapsed time to identify network or queueing delays.
Result CountintegerNumber of documents/rows returned by the query. High values may indicate queries returning excessive data.
Result SizeintegerhiddenTotal size of the result set in bytes. Large result sizes may indicate inefficient queries or missing projections.
Error CountintegerhiddenNumber of errors encountered during query execution. Non-zero values require investigation.
Warning CountintegerhiddenNumber of warnings generated during query execution. Warnings may indicate suboptimal query patterns or index usage.
UserstringCouchbase user who executed the query. Useful for identifying workload by user or application.
Client Context IDstringhiddenClient-provided context identifier for request tracking and correlation.

Alerts

There are no alerts configured by default for this integration.

Setup

You can configure the couchbase collector in two ways:

MethodBest forHow to
UIFast setup without editing filesGo to Nodes → Configure this node → Collectors → Jobs, search for couchbase, then click + to add a job.
FileIf you prefer configuring via file, or need to automate deployments (e.g., with Ansible)Edit go.d/couchbase.conf and add a job.
important

UI configuration requires paid Netdata Cloud plan.

Prerequisites

No action required.

Configuration

Options

The following options can be defined globally: update_every, autodetection_retry.

All options
GroupOptionDescriptionDefaultRequired
Collectionupdate_everyData collection interval (seconds).5no
autodetection_retryAutodetection retry interval (seconds). Set 0 to disable.0no
TargeturlTarget endpoint URL.http://127.0.0.1:8091yes
timeoutHTTP request timeout (seconds).1no
HTTP AuthusernameUsername for Basic HTTP authentication.no
passwordPassword for Basic HTTP authentication.no
bearer_token_filePath to a file containing a bearer token (used for Authorization: Bearer).no
TLStls_skip_verifySkip TLS certificate and hostname verification (insecure).nono
tls_caPath to CA bundle used to validate the server certificate.no
tls_certPath to client TLS certificate (for mTLS).no
tls_keyPath to client TLS private key (for mTLS).no
Proxyproxy_urlHTTP proxy URL.no
proxy_usernameUsername for proxy Basic HTTP authentication.no
proxy_passwordPassword for proxy Basic HTTP authentication.no
RequestmethodHTTP method to use.GETno
bodyRequest body (e.g., for POST/PUT).no
headersAdditional HTTP headers (one per line as key: value).no
not_follow_redirectsDo not follow HTTP redirects.nono
force_http2Force HTTP/2 (including h2c over TCP).nono
Virtual NodevnodeAssociates this data collection job with a Virtual Node.no

via UI

Configure the couchbase collector from the Netdata web interface:

  1. Go to Nodes.
  2. Select the node where you want the couchbase data-collection job to run and click the (Configure this node). That node will run the data collection.
  3. The Collectors → Jobs view opens by default.
  4. In the Search box, type couchbase (or scroll the list) to locate the couchbase collector.
  5. Click the + next to the couchbase collector to add a new job.
  6. Fill in the job fields, then click Test to verify the configuration and Submit to save.
    • Test runs the job with the provided settings and shows whether data can be collected.
    • If it fails, an error message appears with details (for example, connection refused, timeout, or command execution errors), so you can adjust and retest.

via File

The configuration file name for this integration is go.d/couchbase.conf.

The file format is YAML. Generally, the structure is:

update_every: 1
autodetection_retry: 0
jobs:
- name: some_name1
- name: some_name2

You can edit the configuration file using the edit-config script from the Netdata config directory.

cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/couchbase.conf
Examples
Basic

An example configuration.

Config
jobs:
- name: local
url: http://127.0.0.1:8091

Basic HTTP auth

Local server with basic HTTP authentication.

Config
jobs:
- name: local
url: http://127.0.0.1:8091
username: foo
password: bar

Multi-instance

Note: When you define multiple jobs, their names must be unique.

Collecting metrics from local and remote instances.

Config
jobs:
- name: local
url: http://127.0.0.1:8091

- name: remote
url: http://203.0.113.0:8091

Troubleshooting

Debug Mode

Important: Debug mode is not supported for data collection jobs created via the UI using the Dyncfg feature.

To troubleshoot issues with the couchbase collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
  • Switch to the netdata user.

    sudo -u netdata -s
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m couchbase

    To debug a specific job:

    ./go.d.plugin -d -m couchbase -j jobName

Getting Logs

If you're encountering problems with the couchbase collector, follow these steps to retrieve logs and identify potential issues:

  • Run the command specific to your system (systemd, non-systemd, or Docker container).
  • Examine the output for any warnings or error messages that might indicate issues. These messages should provide clues about the root cause of the problem.

System with systemd

Use the following command to view logs generated since the last Netdata service restart:

journalctl _SYSTEMD_INVOCATION_ID="$(systemctl show --value --property=InvocationID netdata)" --namespace=netdata --grep couchbase

System without systemd

Locate the collector log file, typically at /var/log/netdata/collector.log, and use grep to filter for collector's name:

grep couchbase /var/log/netdata/collector.log

Note: This method shows logs from all restarts. Focus on the latest entries for troubleshooting current issues.

Docker Container

If your Netdata runs in a Docker container named "netdata" (replace if different), use this command:

docker logs netdata 2>&1 | grep couchbase

Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.