Skip to content

CBG-4312 improve metrics documentation #7309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions docs/api/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@

openapi: 3.0.3
info:
title: Sync Gateway
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server
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.
version: '3.3'
license:
name: Business Source License 1.1 (BSL)
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 @@ -166,8 +166,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,8 +8,12 @@

openapi: 3.0.3
info:
title: Sync Gateway
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server
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.
version: '3.3'
license:
name: Business Source License 1.1 (BSL)
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,8 +8,12 @@

openapi: 3.0.3
info:
title: Sync Gateway
description: Sync Gateway manages access and synchronization between Couchbase Lite and Couchbase Server
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.
version: '3.3'
license:
name: Business Source License 1.1 (BSL)
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