Monitoring and Metrics
- concept
Available metrics, Prometheus integration, and OpenTelemetry support in Cloud Native Gateway.
Cloud Native Gateway exposes metrics through Prometheus and optionally exports them via OpenTelemetry using OTLP.
Cloud Native Gateway serves metrics on a dedicated web port.
The default is 9091.
This port also provides health check endpoints.
Available Metrics
This section summarizes the metrics that Cloud Native Gateway emits for gRPC, Data API, and Couchbase client activity. Use these metrics to monitor request volume, latency, connection health, and authentication behavior.
Prometheus Endpoint
Cloud Native Gateway exposes metrics in Prometheus exposition format at:
http://<cng-host>:9091/metrics
Cloud Native Gateway serves this endpoint over plain HTTP on the web port for cluster-internal scraping.
gRPC Metrics
Cloud Native Gateway reports the following metrics under the com.couchbase.cloud-native-gateway instrumentation scope:
| Metric | Type | Description |
|---|---|---|
|
|
Total number of gRPC connections created since the gateway started. |
|
|
Number of active gRPC connections. |
|
|
Count of requests by Couchbase SDK client name, extracted from the |
Data API Metrics
Cloud Native Gateway reports the following metrics for Data API HTTPS operations. They use separate instrumentation scopes internal to the Data API and OpenAPI components:
| Metric | Type | Description |
|---|---|---|
|
|
Total number of Data API requests, labeled by |
|
|
Request duration in milliseconds, labeled by |
|
|
Count of Data API requests by recognized Couchbase client name, labeled with |
Couchbase Client Metrics
The gocbcorex client library reports metrics through Cloud Native Gateway’s global OpenTelemetry provider.
These metrics are always active and appear in both the Prometheus endpoint and any configured OTLP export.
The following metrics use the github.com/couchbase/gocbcorex instrumentation scope:
| Metric | Type | Description |
|---|---|---|
|
|
Duration of Couchbase operations in seconds.
Labeled with |
|
|
Current number of open connections to Couchbase Server nodes. |
|
|
Time taken to establish a connection to a Couchbase Server node, in seconds. |
|
|
Total number of connection establishment failures. |
The following metrics use the github.com/couchbase/gocbcorex/cbauthx instrumentation scope:
| Metric | Type | Description |
|---|---|---|
|
|
Duration of authentication checks, in seconds. |
|
|
Duration of certificate validation checks, in seconds. |
|
|
Total number of cbauth reverse-RPC heartbeats received. |
|
|
Total number of cbauth database update events received. |
OpenTelemetry gRPC Server Metrics
When you enable OpenTelemetry, Cloud Native Gateway also reports standard gRPC server metrics via otelgrpc, including per-RPC latency and status code distributions.
These metrics follow the OpenTelemetry semantic conventions for gRPC.
OpenTelemetry Integration
Cloud Native Gateway supports exporting metrics and traces to an OpenTelemetry Collector via gRPC using OTLP:
$ ./cloud-native-gateway --otlp-endpoint otel-collector.monitoring:4317
| Flag | Description |
|---|---|
|
The gRPC address of the OpenTelemetry Collector. |
|
Disable all metrics collection. |
|
Disable all trace collection. |
|
Disables OTLP metric export. The Prometheus endpoint remains active. |
|
Disable exporting traces to OTLP. |
|
Enables tracing for all requests. By default, the parent context determines sampling. |
|
Comma-separated list of headers for the OTLP exporter — for example, |
Cloud Native Gateway always enables the Prometheus exporter, and metrics collection is enabled by default.
When you specify --otlp-endpoint, Cloud Native Gateway also adds an OTLP exporter as an additional metrics reader.
The OpenTelemetry resource includes:
-
Service name:
couchbase-cloud-native-gateway -
Process, host, and telemetry SDK attributes.
-
Build version of Cloud Native Gateway.
Monitoring Limitations
-
No built-in dashboards — Cloud Native Gateway does not ship with pre-built Grafana or monitoring dashboards. You must create dashboards based on the metrics documented in this topic.
-
Unencrypted web port — Cloud Native Gateway serves the metrics and health endpoint on port
9091over plain HTTP. In production, make sure this port is not exposed outside the cluster network. -
Per-instance metrics — In sidecar deployments, each Cloud Native Gateway instance reports its own metrics independently. Use Prometheus service discovery or Kubernetes pod labels to aggregate across instances.
-
OTLP export is gRPC only — The OTLP exporter uses gRPC via
otlpmetricgrpcandotlptracegrpc. HTTP-based OTLP export is not supported.