Skip to content
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

#1145 - Documentation for /api/v1/express-metrics #1146

Merged
merged 3 commits into from
Aug 4, 2023
Merged
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
21 changes: 19 additions & 2 deletions content/en/apps/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ GET /api/v1/forms/NPYY.json
### POST /api/v1/forms/validate

*Added in 3.12.0*

Validate the XForm passed. Require the `can_configure` permission.

#### Headers
Expand Down Expand Up @@ -774,7 +775,7 @@ If `app_settings.app_url` is not defined, the generated token-login URL will use

### GET /api/v1/users

*DEPRECATED: use /api/v2/users*
*DEPRECATED: use [/api/v2/users](#get-apiv2users)*

Returns a list of users and their profile data in JSON format.

Expand Down Expand Up @@ -1111,6 +1112,7 @@ Content-Type: application/json
### POST /api/v2/users

*Added in 3.16.0*

Create new users with a place and a contact from a CSV file.

Creating users from a CSV file behaves the same as passing a JSON array of users into the [`POST /api/v1/users`]({{< ref "apps/reference/api#post-apiv1users" >}})
Expand Down Expand Up @@ -1459,7 +1461,8 @@ See the [Monitoring and alerting on the CHT]({{< relref "apps/guides/hosting/mon

### GET /api/v1/monitoring

*Deprecated in 3.12.x in favor of [/api/v2/monitoring](#get-apiv2monitoring)*
*DEPRECATED: use [/api/v2/monitoring](#get-apiv2monitoring)*

Used to retrieve a range of metrics about the instance. While the output is human-readable this is intended for automated monitoring allowing for tracking trends over time and alerting about potential issues.

#### Permissions
Expand Down Expand Up @@ -1577,6 +1580,18 @@ curl http://localhost:5988/api/v2/monitoring
- A metric of `""` (for string values) or `-1` (for numeric values) indicates an error occurred while querying the metric - check the API logs for details.
- If no response or an error response is received the instance is unreachable. Thus, this API can be used as an uptime monitoring endpoint.

### GET /api/v1/express-metrics

*Added in 4.3.0*

Used to retrieve a range of metrics for monitoring CHT API's performance and internals. This API is used by [CHT Watchdog]({{< ref "/core/overview/watchdog" >}}).

The response is formatted for the [Prometheus Data Model](https://prometheus.io/docs/concepts/data_model/). The metrics exposed are defined by the [prometheus-api-metrics package](https://www.npmjs.com/package/prometheus-api-metrics) and include optional default metrics and garbage collection metrics.

#### Permissions

No permissions required.

## Upgrades

All of these endpoints require the `can_configure` permission.
Expand Down Expand Up @@ -1690,6 +1705,7 @@ Content-Type: application/json
## Contacts by phone

*Added in 3.10.0*

Accepts a phone number parameter and returns fully hydrated contacts that match the requested phone number.
If multiple contacts are found, all are returned. When no matches are found, a 404 error is returned.
Supports both GET and POST.
Expand Down Expand Up @@ -1763,6 +1779,7 @@ Content-Type: application/json
## Replication Limit

*Added in 3.11.0*

Returns the quantity of documents that were replicated by each user.
Accepts filtering by user name, when not provided, it returns all users.
Supports GET.
Expand Down
Loading