Skip to content

Commit 34d1b16

Browse files
authored
[3.2.3 backport] CBG-4326 improve metrics documentation (#7354)
1 parent 1f59621 commit 34d1b16

File tree

7 files changed

+44
-53
lines changed

7 files changed

+44
-53
lines changed

docs/api/admin.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88

99
openapi: 3.0.3
1010
info:
11-
title: Sync Gateway
12-
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server
1311
version: '3.2'
12+
title: Sync Gateway Admin REST API
13+
description: |-
14+
# Introduction
15+
16+
The Sync Gateway Admin REST API is used to administer user accounts and roles, and to run administrative tasks in superuser mode.
1417
license:
1518
name: Business Source License 1.1 (BSL)
1619
url: 'https://github.com/couchbase/sync_gateway/blob/master/LICENSE'
@@ -129,7 +132,8 @@ paths:
129132
'/{keyspace}/':
130133
$ref: './paths/admin/keyspace-.yaml'
131134
/_expvar:
132-
$ref: ./paths/admin/_expvar.yaml
135+
# use the same path as for metrics
136+
$ref: ./paths/metric/_expvar.yaml
133137
/:
134138
$ref: ./paths/admin/-.yaml
135139
/_ping:
@@ -207,5 +211,5 @@ tags:
207211
- name: Unsupported
208212
description: Endpoints that are not supported by Sync Gateway
209213
externalDocs:
210-
description: Sync Gateway Quickstart | Couchbase Docs
211-
url: 'https://docs.couchbase.com/sync-gateway/current/index.html'
214+
description: ⬆️ Admin REST API Overview
215+
url: rest-api-admin.html

docs/api/components/schemas.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ ExpVars:
169169
description: "The total uptime."
170170
per_db:
171171
description: |-
172-
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.
173-
The statistics for each {$db_name} database are grouped into:
172+
This array contains stats for all databases declared in the config file — see [View Statistics and Metrics](stats-monitoring.html) for more details on the metrics collected and reported by Sync Gateway.
173+
174+
The statistics for each database are grouped into:
174175
- cache related statistics
175176
- collections statistics
176177
- cbl_replication_push

docs/api/metric.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88

99
openapi: 3.0.3
1010
info:
11-
title: Sync Gateway
12-
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server
1311
version: '3.2'
12+
title: Sync Gateway Metrics REST API
13+
description: |-
14+
# Introduction
15+
16+
Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server.
17+
The Sync Gateway Metrics REST API returns Sync Gateway metrics, in JSON or Prometheus-compatible formats, for performance monitoring and diagnostic purposes.
1418
license:
1519
name: Business Source License 1.1 (BSL)
1620
url: 'https://github.com/couchbase/sync_gateway/blob/master/LICENSE'
@@ -32,13 +36,18 @@ paths:
3236
$ref: ./paths/common/_ping.yaml
3337
/_metrics:
3438
$ref: ./paths/metric/metrics.yaml
39+
x-internal: true
3540
/metrics:
3641
$ref: ./paths/metric/metrics.yaml
3742
/_expvar:
3843
$ref: ./paths/metric/_expvar.yaml
3944
tags:
4045
- name: Prometheus
4146
description: Endpoints for use with Prometheus
47+
- name: JSON
48+
description: Endpoints for use with JSON metrics
49+
- name: Server
50+
description: Endpoints for managing the REST API
4251
externalDocs:
43-
description: Sync Gateway Quickstart | Couchbase Docs
44-
url: 'https://docs.couchbase.com/sync-gateway/current/index.html'
52+
description: ⬆️ Metrics REST API Overview
53+
url: rest-api-metrics.html

docs/api/paths/admin/_expvar.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/api/paths/metric/_expvar.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# software will be governed by the Apache License, Version 2.0, included in
88
# the file licenses/APL2.txt.
99
get:
10-
summary: Get all Sync Gateway statistics
10+
summary: Get all Sync Gateway statistics in JSON format
1111
description: |-
1212
This returns a snapshot of all metrics in Sync Gateway for debugging and monitoring purposes.
1313
@@ -18,11 +18,15 @@ get:
1818
* Sync Gateway Architect
1919
* Sync Gateway Dev Ops
2020
* External Stats Reader
21+
tags:
22+
- JSON
2123
responses:
2224
'200':
23-
description: Returned statistics
25+
description: |-
26+
Successfully returned statistics.
27+
For details, see [JSON Metrics](stats-monitoring-json.html).
2428
content:
25-
application/javascript:
29+
application/json:
2630
schema:
2731
$ref: ../../components/schemas.yaml#/ExpVars
2832
operationId: get__expvar

docs/api/paths/metric/metrics.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# software will be governed by the Apache License, Version 2.0, included in
77
# the file licenses/APL2.txt.
88
get:
9-
summary: Debugging/monitoring runtime stats in Prometheus Exposition format
9+
summary: Get debugging and monitoring runtime stats in Prometheus Exposition format
1010
description: |-
1111
Returns Sync Gateway statistics and other runtime variables in Prometheus Exposition format.
1212
@@ -17,11 +17,9 @@ get:
1717
* External Stats Reader
1818
responses:
1919
'200':
20-
description: Successfully returned stats
21-
content:
22-
text/plain:
23-
schema:
24-
type: string
20+
description: |-
21+
Successfully returned statistics.
22+
For details, see [Prometheus Metrics](stats-monitoring-prometheus.html).
2523
tags:
2624
- Prometheus
2725
operationId: get_metrics

docs/api/public.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88

99
openapi: 3.0.3
1010
info:
11-
title: Sync Gateway
12-
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server
1311
version: '3.2'
12+
title: Sync Gateway Public REST API
13+
description: |-
14+
# Introduction
15+
16+
Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server.
17+
The Sync Gateway Public REST API is used for client replication.
1418
license:
1519
name: Business Source License 1.1 (BSL)
1620
url: 'https://github.com/couchbase/sync_gateway/blob/master/LICENSE'
@@ -108,5 +112,5 @@ tags:
108112
description: Endpoints that are not supported by Sync Gateway
109113
x-capella: false
110114
externalDocs:
111-
description: Sync Gateway Quickstart | Couchbase Docs
112-
url: 'https://docs.couchbase.com/sync-gateway/current/index.html'
115+
description: ⬆️ Public REST API Overview
116+
url: rest-api.html

0 commit comments

Comments
 (0)