Couchbase

Stay organized with collections Save and categorize content based on your preferences.

The Couchbase integration collects bucket metrics such as operations, memory usage, and ejections. The integration collects metrics from the Prometheus server exposed on a node. The integration also collects Couchbase general, HTTP access, and cross-datacenter ("goxdcr") logs`.

For more information about couchbase, see the Couchbase documentation.

Prerequisites

To collect couchbase telemetry, you must install the Ops Agent version 2.18.2 or higher.

This integration supports couchbase versions 6.5, 6.6, and 7.0.

Configure the Ops Agent for couchbase

Following the guide for Configuring the Ops Agent, add the required elements to collect telemetry from couchbase instances, and restart the agent.

Example configuration

The following command creates the configuration to collect and ingest telemetry for couchbase and restarts the Ops Agent.

# Configures Ops Agent to collect telemetry from the app and restart Ops Agent.

set -e

sudo tee /etc/google-cloud-ops-agent/config.yaml > /dev/null << EOF
metrics:
  receivers:
    couchbase:
      type: couchbase
      username: admin
      password: password
      collection_interval: 30s
  service:
    pipelines:
      couchbase:
        receivers:
          - couchbase

logging:
  receivers:
    couchbase_general:
      type: couchbase_general
    couchbase_http_access:
      type: couchbase_http_access
    couchbase_goxdcr:
      type: couchbase_goxdcr
  service:
    pipelines:
      couchbase:
        receivers:
          - couchbase_general
          - couchbase_http_access
          - couchbase_goxdcr

EOF

sudo service google-cloud-ops-agent restart
sleep 30s

What is logged

The logName is derived from the receiver IDs specified in the configuration. Detailed fields inside the LogEntry are as follows.

The couchbase_general logs contain the following fields in the LogEntry:

Field Type Description
jsonPayload.message string Log message
jsonPayload.node_name string The name of the node issuing the log message
jsonPayload.module_name string The name of the module issuing the entry

The couchbase_http_access logs contain the following fields in the LogEntry:

Field Type Description
jsonPayload.message string Log message
jsonPayload.client_ip string The IP address of the client invoking the HTTP request
jsonPayload.user string The name of the user making the HTTP request if basic auth is used.
jsonPayload.method string The HTTP method of the request
jsonPayload.status_code integer The status code of the response of the HTTP request

The couchbase_goxdcr logs contain the following fields in the LogEntry:

Field Type Description
jsonPayload.message string Log message
log_type string The name of the component that is issuing the cross-datacenter log

Configure metrics collection

To ingest metrics from couchbase, you must create receivers for the metrics that couchbase produces and then create a pipeline for the new receivers.

To configure a receiver for your couchbase metrics, specify the following fields:

Field Default Description
collection_interval 60s A time.Duration value, such as 30s or 5m.
endpoint localhost:8091 The URL of the node to monitor.
password The password used to connect to the couchbase server.
type This value must be couchbase.
username The username used to connect to the couchbase server.

What is monitored

The following table provides the list of metrics that the Ops Agent collects from the couchbase instance.

Metric type 
Kind, Type
Monitored resources
Labels
workload.googleapis.com/couchbase.bucket.error.oom.count
CUMULATIVEINT64
gce_instance
bucket_name
error_type
workload.googleapis.com/couchbase.bucket.item.count
GAUGEDOUBLE
gce_instance
bucket_name
state
workload.googleapis.com/couchbase.bucket.item.ejection.count
CUMULATIVEINT64
gce_instance
bucket_name
workload.googleapis.com/couchbase.bucket.memory.high_water_mark.limit
GAUGEDOUBLE
gce_instance
bucket_name
workload.googleapis.com/couchbase.bucket.memory.low_water_mark.limit
GAUGEDOUBLE
gce_instance
bucket_name
workload.googleapis.com/couchbase.bucket.memory.usage
GAUGEDOUBLE
gce_instance
bucket_name
workload.googleapis.com/couchbase.bucket.operation.count
CUMULATIVEINT64
gce_instance
bucket_name
op
workload.googleapis.com/couchbase.bucket.vbucket.count
GAUGEDOUBLE
gce_instance
bucket_name
state

Sample dashboard

To view your couchbase metrics, you must have a chart or dashboard configured. Cloud Monitoring provides a library of sample dashboards for integrations, which contain preconfigured charts. For information about installing these dashboards, see Installing sample dashboards.

Verify the configuration

This section describes how to verify that you correctly configured the couchbase receiver. It might take one or two minutes for the Ops Agent to begin collecting telemetry.

To verify that the logs are ingested, go to the Logs Explorer and run the following query to view the couchbase logs:

resource.type="gce_instance"
(log_id("couchbase_general") OR log_id("couchbase_http_access") OR log_id("couchbase_goxdcr"))

To verify that the metrics are ingested, go to Metrics Explorer and run the following query in the MQL tab:

fetch gce_instance
| metric 'workload.googleapis.com/couchbase.bucket.memory.usage'
| every 1m

What's next

For a walkthrough on how to use Ansible to install the Ops Agent, configure a third-party application, and install a sample dashboard, see the Install the Ops Agent to troubleshoot third-party applications video.