Sync Gateway Metrics REST API (4.1)

Download OpenAPI specification:

Introduction

Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server. The Sync Gateway Metrics REST API returns Sync Gateway metrics, in JSON or Prometheus-compatible formats, for performance monitoring and diagnostic purposes.

Prometheus

Endpoints for use with Prometheus

Get debugging and monitoring runtime stats in Prometheus Exposition format

Returns Sync Gateway statistics and other runtime variables in Prometheus Exposition format.

For detailed metrics descriptions, see Prometheus Metrics.

Required Sync Gateway RBAC roles:

  • Sync Gateway Architect
  • Sync Gateway Dev Ops
  • External Stats Reader

Responses

Response samples

Content type
# HELP go_gc_duration_seconds A summary of the wall-time pause (stop-the-world) duration in garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 3.2374e-05
go_gc_duration_seconds{quantile="0.25"} 3.6417e-05
go_gc_duration_seconds{quantile="0.5"} 7.9875e-05
go_gc_duration_seconds{quantile="0.75"} 0.000152499
go_gc_duration_seconds{quantile="1"} 0.001503708
go_gc_duration_seconds_sum 0.002018457
go_gc_duration_seconds_count 7
# HELP go_gc_gogc_percent Heap size target percentage configured by the user, otherwise 100. This value is set by the GOGC environment variable, and the runtime/debug.SetGCPercent function. Sourced from /gc/gogc:percent
# TYPE go_gc_gogc_percent gauge
go_gc_gogc_percent 100
...

JSON

Endpoints for use with JSON metrics

Get all Sync Gateway statistics in JSON format

This returns a snapshot of all metrics in Sync Gateway for debugging and monitoring purposes.

This includes per database stats, replication stats, and server stats.

For details, see JSON Metrics.

Required Sync Gateway RBAC roles:

  • Sync Gateway Architect
  • Sync Gateway Dev Ops
  • External Stats Reader

Responses

Response samples

Content type
application/json
{
  • "cmdline": { },
  • "memstats": { },
  • "cb": { },
  • "mc": { },
  • "syncGateway_changeCache": {
    },
  • "syncGateway_db": {
    },
  • "syncgateway": {
    }
}

Server

Endpoints for managing the REST API

Check if API is available

Returns OK status if API is available.

Responses

Response samples

Content type
text/plain
OK