Configure Prometheus Metrics Collection
You can set up the Autonomous Operator to use the Couchbase Prometheus Exporter for metrics collection.
Prometheus is the de facto metrics collection platform for use in Kubernetes environments. The Autonomous Operator provides native integration with the Couchbase Prometheus Exporter for collecting and exposing Couchbase Server metrics.
Prometheus metrics collection is enabled in the
apiVersion: couchbase/v2 kind: CouchbaseCluster spec: monitoring: prometheus: enabled: true (1) image: couchbase/exporter:1.0.3 (2) authorizationSecret: cb-metrics-token (3)
If pulling directly from the the Red Hat Container Catalog, then the path will be something similar to
|3||You can optionally specify a Kubernetes Secret that contains a bearer token value that clients will need to use to gain access to the Prometheus metrics.|
If you wish to create a Kubernetes secret with a bearer token, simply edit and create the following definition:
You can enable/disable Prometheus metric collection at any time during the cluster’s lifecycle. However, since
Podresources are immutable, enabling or disabling metric collection will require a rolling upgrade of the cluster.
Only official Prometheus images provided by Couchbase are supported.
In addition, you should ensure that your image source is trusted. The sidecar container requires access to the Couchbase cluster administrative credentials in order to login and perform collection. Granting these credentials to arbitrary code is potentially harmful.
Once configured, active metrics can be collected from each Couchbase Server pod on port 9091.
The Autonomous Operator does not create or manage resources for third-party software. Prometheus scrape targets must be manually created by the user. However, you might find the following resources helpful when setting up your Prometheus environment: