Skip to content

Commit

Permalink
[3.2.3 backport] CBG-4326 improve metrics documentation (#7354)
Browse files Browse the repository at this point in the history
  • Loading branch information
torcolvin authored Feb 4, 2025
1 parent 1f59621 commit 34d1b16
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 53 deletions.
14 changes: 9 additions & 5 deletions docs/api/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

openapi: 3.0.3
info:
title: Sync Gateway
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server
version: '3.2'
title: Sync Gateway Admin REST API
description: |-
# Introduction
The Sync Gateway Admin REST API is used to administer user accounts and roles, and to run administrative tasks in superuser mode.
license:
name: Business Source License 1.1 (BSL)
url: 'https://github.com/couchbase/sync_gateway/blob/master/LICENSE'
Expand Down Expand Up @@ -129,7 +132,8 @@ paths:
'/{keyspace}/':
$ref: './paths/admin/keyspace-.yaml'
/_expvar:
$ref: ./paths/admin/_expvar.yaml
# use the same path as for metrics
$ref: ./paths/metric/_expvar.yaml
/:
$ref: ./paths/admin/-.yaml
/_ping:
Expand Down Expand Up @@ -207,5 +211,5 @@ tags:
- name: Unsupported
description: Endpoints that are not supported by Sync Gateway
externalDocs:
description: Sync Gateway Quickstart | Couchbase Docs
url: 'https://docs.couchbase.com/sync-gateway/current/index.html'
description: ⬆️ Admin REST API Overview
url: rest-api-admin.html
5 changes: 3 additions & 2 deletions docs/api/components/schemas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ ExpVars:
description: "The total uptime."
per_db:
description: |-
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:
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.
The statistics for each database are grouped into:
- cache related statistics
- collections statistics
- cbl_replication_push
Expand Down
17 changes: 13 additions & 4 deletions docs/api/metric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@

openapi: 3.0.3
info:
title: Sync Gateway
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server
version: '3.2'
title: Sync Gateway Metrics REST API
description: |-
# 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.
license:
name: Business Source License 1.1 (BSL)
url: 'https://github.com/couchbase/sync_gateway/blob/master/LICENSE'
Expand All @@ -32,13 +36,18 @@ paths:
$ref: ./paths/common/_ping.yaml
/_metrics:
$ref: ./paths/metric/metrics.yaml
x-internal: true
/metrics:
$ref: ./paths/metric/metrics.yaml
/_expvar:
$ref: ./paths/metric/_expvar.yaml
tags:
- name: Prometheus
description: Endpoints for use with Prometheus
- name: JSON
description: Endpoints for use with JSON metrics
- name: Server
description: Endpoints for managing the REST API
externalDocs:
description: Sync Gateway Quickstart | Couchbase Docs
url: 'https://docs.couchbase.com/sync-gateway/current/index.html'
description: ⬆️ Metrics REST API Overview
url: rest-api-metrics.html
29 changes: 0 additions & 29 deletions docs/api/paths/admin/_expvar.yaml

This file was deleted.

10 changes: 7 additions & 3 deletions docs/api/paths/metric/_expvar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# software will be governed by the Apache License, Version 2.0, included in
# the file licenses/APL2.txt.
get:
summary: Get all Sync Gateway statistics
summary: Get all Sync Gateway statistics in JSON format
description: |-
This returns a snapshot of all metrics in Sync Gateway for debugging and monitoring purposes.
Expand All @@ -18,11 +18,15 @@ get:
* Sync Gateway Architect
* Sync Gateway Dev Ops
* External Stats Reader
tags:
- JSON
responses:
'200':
description: Returned statistics
description: |-
Successfully returned statistics.
For details, see [JSON Metrics](stats-monitoring-json.html).
content:
application/javascript:
application/json:
schema:
$ref: ../../components/schemas.yaml#/ExpVars
operationId: get__expvar
10 changes: 4 additions & 6 deletions docs/api/paths/metric/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# software will be governed by the Apache License, Version 2.0, included in
# the file licenses/APL2.txt.
get:
summary: Debugging/monitoring runtime stats in Prometheus Exposition format
summary: Get debugging and monitoring runtime stats in Prometheus Exposition format
description: |-
Returns Sync Gateway statistics and other runtime variables in Prometheus Exposition format.
Expand All @@ -17,11 +17,9 @@ get:
* External Stats Reader
responses:
'200':
description: Successfully returned stats
content:
text/plain:
schema:
type: string
description: |-
Successfully returned statistics.
For details, see [Prometheus Metrics](stats-monitoring-prometheus.html).
tags:
- Prometheus
operationId: get_metrics
12 changes: 8 additions & 4 deletions docs/api/public.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@

openapi: 3.0.3
info:
title: Sync Gateway
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server
version: '3.2'
title: Sync Gateway Public REST API
description: |-
# Introduction
Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server.
The Sync Gateway Public REST API is used for client replication.
license:
name: Business Source License 1.1 (BSL)
url: 'https://github.com/couchbase/sync_gateway/blob/master/LICENSE'
Expand Down Expand Up @@ -108,5 +112,5 @@ tags:
description: Endpoints that are not supported by Sync Gateway
x-capella: false
externalDocs:
description: Sync Gateway Quickstart | Couchbase Docs
url: 'https://docs.couchbase.com/sync-gateway/current/index.html'
description: ⬆️ Public REST API Overview
url: rest-api.html

0 comments on commit 34d1b16

Please sign in to comment.