Management Interfaces

  • concept
The web management interface, health checks, and runtime configuration options for Cloud Native Gateway.

Cloud Native Gateway provides a lightweight HTTP management interface for health monitoring, metrics, and runtime diagnostics. This interface uses a dedicated web port, separate from the client-facing gRPC and Data API ports. The default port is 9091.

REST API

Health and Readiness Endpoints

Cloud Native Gateway exposes Kubernetes-compatible health and readiness probes:

Endpoint Method Description

/live

GET

Liveness probe. Returns 200 OK as soon as the Cloud Native Gateway process is running. Use this for Kubernetes livenessProbe configuration.

/ready

GET

Readiness probe. Returns 200 OK once Cloud Native Gateway has connected to Couchbase Server and is ready to serve traffic. Returns 503 Service Unavailable while Cloud Native Gateway is still initializing. Use this for Kubernetes readinessProbe configuration.

/health

GET

Alias for /ready. Returns the same readiness status.

/metrics

GET

Prometheus metrics endpoint. See Monitoring and Metrics for details on available metrics.

Example Kubernetes Probe Configuration

containers:
  - name: cloud-native-gateway
    livenessProbe:
      httpGet:
        path: /live
        port: 9091
      initialDelaySeconds: 5
      periodSeconds: 10
    readinessProbe:
      httpGet:
        path: /ready
        port: 9091
      initialDelaySeconds: 10
      periodSeconds: 5

Go Runtime Profiling Endpoints

The --pprof flag enables Go runtime profiling endpoints under /debug/pprof/ on the web port:

Endpoint Description

/debug/pprof/

Index of available profiles.

/debug/pprof/profile

CPU profile. The default duration is 30 seconds.

/debug/pprof/heap

Heap memory profile.

/debug/pprof/goroutine

Stack traces of all current goroutines.

/debug/pprof/allocs

Allocation profile.

/debug/pprof/block

Blocking profile.

/debug/pprof/mutex

Mutex contention profile.

/debug/pprof/trace

Execution trace.

pprof endpoints expose detailed runtime internals. Enable them only when actively investigating a performance issue, and do not use --pprof in production deployments.

gRPC Health Check

In addition to the HTTP health endpoints, Cloud Native Gateway implements the standard gRPC health checking protocol on the Protostellar gRPC port. Verify this using gRPCurl, which is "like curl, but for gRPC". The gRPC standard health check is a simple way to do this.

Call grpcurl against a default Health/Check once you have the definition. To get the RPC definition:

$ curl -o health.proto https://raw.githubusercontent.com/grpc/grpc-proto/master/grpc/health/v1/health.proto

Then check against the healthcheck endpoint with:

$ grpcurl --insecure -proto health.proto -d '{ "service": "hello" }' localhost:18098 grpc.health.v1.Health/Check

And you should see a response:

{
  "status": "SERVING"
}

Individual gRPC services also report their health status, so you can query a specific service:

$ grpcurl --insecure -proto health.proto localhost:18098 grpc.health.v1.Health/Check \
    -d '{"service": "couchbase.kv.v1.KvService"}'