Download OpenAPI specification:
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.
Returns Sync Gateway statistics and other runtime variables in Prometheus Exposition format.
For detailed metrics descriptions, see Prometheus Metrics.
Required Sync Gateway RBAC roles:
# 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 ...
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:
{- "cmdline": { },
- "memstats": { },
- "cb": { },
- "mc": { },
- "syncGateway_changeCache": {
- "maxPending": { },
- "lag-tap-0000ms": { },
- "lag-queue-0000ms": { },
- "lag-total-0000ms": { },
- "outOfOrder": { },
- "view_queries": { }
}, - "syncGateway_db": {
- "channelChangesFeeds": { },
- "channelLogAdds": { },
- "channelLogAppends": { },
- "channelLogCacheHits": { },
- "channelLogRewrites": { },
- "channelLogRewriteCollisions": { },
- "document_gets": { },
- "revisionCache_adds": { },
- "revisionCache_hits": { },
- "revisionCache_misses": { },
- "revs_added": { },
- "sequence_gets": { },
- "sequence_reserves": { }
}, - "syncgateway": {
- "global": {
- "resource_utilization": {
- "admin_net_bytes_recv": 0,
- "admin_net_bytes_sent": 0,
- "error_count": 0,
- "go_memstats_heapalloc": 0,
- "go_memstats_heapidle": 0,
- "go_memstats_heapinuse": 0,
- "go_memstats_heapreleased": 0,
- "go_memstats_pausetotalns": 0,
- "go_memstats_stackinuse": 0,
- "go_memstats_stacksys": 0,
- "go_memstats_sys": 0,
- "goroutines_high_watermark": 0,
- "num_goroutines": 0,
- "num_idle_kv_ops": 0,
- "num_idle_query_ops": 0,
- "process_cpu_percent_utilization": 0.1,
- "node_cpu_percent_utilization": 0.1,
- "process_memory_resident": 0,
- "pub_net_bytes_recv": 0,
- "pub_net_bytes_sent": 0,
- "system_memory_total": 0,
- "warn_count": 0,
- "uptime": 0
}
}, - "per_db": [
- {
- "cache": { },
- "database": { },
- "per_replication": { },
- "collections": { },
- "security": { }
}
], - "per_replication": [
- {
- "$replication_id": {
- "sgr_active": true,
- "sgr_docs_checked_sent": 0,
- "sgr_num_attachments_transferred": 0,
- "sgr_num_attachment_bytes_transferred": 0,
- "sgr_num_docs_failed_to_push": 0,
- "sgr_num_docs_pushed": 0
}
}
]
}
}