Metrics REST API (Static Page)
Description of the Sync Gateway Metrics REST API, alternative representation as a static page
Related REST API topics: Public REST API (Static Page) | Admin REST API (Static Page)
Resources
This section describes the operations available with this REST API. The operations are grouped in the following categories.
default
Table of Contents
Get all Sync Gateway statistics
GET /_expvar
Description
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.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Dev Ops
- External Stats Reader
Prometheus
Endpoints for use with Prometheus
Debugging/monitoring runtime stats in Prometheus Exposition format
GET /_metrics
Description
Returns Sync Gateway statistics and other runtime variables in Prometheus Exposition format.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Dev Ops
- External Stats Reader
Debugging/monitoring runtime stats in Prometheus Exposition format
GET /metrics
Description
Returns Sync Gateway statistics and other runtime variables in Prometheus Exposition format.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Dev Ops
- External Stats Reader
Definitions
This section describes the properties consumed and returned by this REST API.
ExpVars
Name | Description | Schema |
---|---|---|
cmdline |
Built-in variables from the Go runtime, lists the command-line arguments |
Object |
memstats |
Dumps a large amount of information about the memory heap and garbage collector |
Object |
cb |
Variables reported by the Couchbase SDK (go_couchbase package) |
Object |
mc |
Variables reported by the low-level memcached API (gomemcached package) |
Object |
syncGateway_changeCache |
||
syncGateway_db |
||
syncgateway |
Monitoring stats |
GetExpvar200Response
Name | Description | Schema |
---|---|---|
cmdline |
Built-in variables from the Go runtime, lists the command-line arguments |
Object |
memstats |
Dumps a large amount of information about the memory heap and garbage collector |
Object |
cb |
Variables reported by the Couchbase SDK (go_couchbase package) |
Object |
mc |
Variables reported by the low-level memcached API (gomemcached package) |
Object |
syncGateway_changeCache |
||
syncGateway_db |
||
syncgateway |
Monitoring stats |
GetExpvar200ResponseSyncGatewayChangeCache
Name | Description | Schema |
---|---|---|
maxPending |
Max number of sequences waiting on a missing earlier sequence number |
Object |
lag-tap-0000ms |
Histogram of delay from doc save till it shows up in Tap feed |
Object |
lag-queue-0000ms |
Histogram of delay from Tap feed till doc is posted to changes feed |
Object |
lag-total-0000ms |
Histogram of total delay from doc save till posted to changes feed |
Object |
outOfOrder |
Number of out-of-order sequences posted |
Object |
view_queries |
Number of queries to channels view |
Object |
GetExpvar200ResponseSyncGatewayDb
Name | Description | Schema |
---|---|---|
channelChangesFeeds |
Number of calls to db.changesFeed, i.e. generating a changes feed for a single channel. |
Object |
channelLogAdds |
Number of entries added to channel logs |
Object |
channelLogAppends |
Number of times entries were written to channel logs using an APPEND operation |
Object |
channelLogCacheHits |
Number of requests for channel-logs that were fulfilled from the in-memory cache |
Object |
channelLogRewrites |
Number of times entries were written to channel logs using a SET operation (rewriting the entire log) |
Object |
channelLogRewriteCollisions |
Number of collisions while attempting to rewrite channel logs using SET |
Object |
document_gets |
Number of times a document was read from the database |
Object |
revisionCache_adds |
Number of revisions added to the revision cache |
Object |
revisionCache_hits |
Number of times a revision-cache lookup succeeded |
Object |
revisionCache_misses |
Number of times a revision-cache lookup failed |
Object |
revs_added |
Number of revisions added to the database (including deletions) |
Object |
sequence_gets |
Number of times the database’s lastSequence was read |
Object |
sequence_reserves |
Number of times the database’s lastSequence was incremented |
Object |
GetExpvar200ResponseSyncgateway
Name | Description | Schema |
---|---|---|
global |
Global Sync Gateway stats |
|
per_db |
This array contains stats for all databases declared in the config file — see the [Sync Gateway Statistics Schema](./../stats-monitoring.html) for more details on the metrics collected and reported by Sync Gateway.
The statistics for each {$db_name} database are grouped into:
- cache related statistics
- collections statistics
- cbl_replication_push
- cbl_replication_pull
- database_related_statistics
- delta_sync
- gsi_views
- security_related_statistics
- shared_bucket_import
- per_replication statistics for each |
|
per_replication |
An array of stats for each replication declared in the config file Deprecated @ 2.8: used only by inter-sync-gateway replications version 1. |
get__expvar_200_response_syncgateway_per_replication_inner List |
GetExpvar200ResponseSyncgatewayGlobal
Name | Description | Schema |
---|---|---|
resource_utilization |
Resource utilization stats |
get__expvar_200_response_syncgateway_global_resource_utilization |
GetExpvar200ResponseSyncgatewayGlobalResourceUtilization
Name | Description | Schema |
---|---|---|
admin_net_bytes_recv |
Integer |
|
admin_net_bytes_sent |
Integer |
|
error_count |
Integer |
|
go_memstats_heapalloc |
Integer |
|
go_memstats_heapidle |
Integer |
|
go_memstats_heapinuse |
Integer |
|
go_memstats_heapreleased |
Integer |
|
go_memstats_pausetotalns |
Integer |
|
go_memstats_stackinuse |
Integer |
|
go_memstats_stacksys |
Integer |
|
go_memstats_sys |
Integer |
|
goroutines_high_watermark |
Integer |
|
num_goroutines |
Integer |
|
process_cpu_percent_utilization |
Integer |
|
process_memory_resident |
Integer |
|
pub_net_bytes_recv |
Integer |
|
pub_net_bytes_sent |
Integer |
|
system_memory_total |
Integer |
|
warn_count |
Integer |
GetExpvar200ResponseSyncgatewayPerDbInner
Name | Description | Schema |
---|---|---|
cache |
Object |
|
database |
Object |
|
per_replication |
Object |
|
collections |
Object |
|
security |
Object |
GetExpvar200ResponseSyncgatewayPerReplicationInner
Name | Description | Schema |
---|---|---|
$replication_id |
get__expvar_200_response_syncgateway_per_replication_inner__replication_id |
GetExpvar200ResponseSyncgatewayPerReplicationInnerReplicationId
Name | Description | Schema |
---|---|---|
sgr_active |
Whether the replication is active at this time. Deprecated @ 2.8: used only by inter-sync-gateway replications version 1. |
Boolean |
sgr_docs_checked_sent |
The total number of documents checked for changes since replication started. This represents the number of potential change notifications pushed by Sync Gateway. Constraints This is not necessarily the number of documents pushed, as a given target might already have the change. Used by versions 1 and 2. |
Integer |
sgr_num_attachments_transferred |
The total number of attachments transferred since replication started. Deprecated @ 2.8: used only by inter-sync-gateway replications version 1. |
Integer |
sgr_num_attachment_bytes_transferred |
The total number of attachment bytes transferred since replication started. Deprecated @ 2.8: used only by inter-sync-gateway replications version 1. |
Integer |
sgr_num_docs_failed_to_push |
The total number of documents that failed to be pushed since replication started. Used by versions 1 and 2. |
Integer |
sgr_num_docs_pushed |
The total number of documents that were pushed since replication started. Used by versions 1 and 2. |
Integer |