-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add health checks documentation (#673)
* Add health checks documentation * Clean up * Apply suggestions from code review Co-authored-by: Jon Torre <[email protected]> * Add env vars * Apply suggestions from code review Co-authored-by: Jon Torre <[email protected]> * Update health-checks.md * Change environment variable list to table with CLI references This commit changes the list of NGINX Agent variables to a table showing how it maps to the CLI flags, with an exception for the variable that doesn't have a flag yet. It links to the CLI flag section so that the reader can view the descriptions for additional context. * Fix small typo in Docker documentation * Add pending health status (#672) * Add pending health status for Agent v2 --------- Co-authored-by: Jon Torre <[email protected]> Co-authored-by: Alan Dooley <[email protected]>
- Loading branch information
1 parent
ab64080
commit 10193ba
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
title: "Health checks" | ||
draft: false | ||
weight: 400 | ||
toc: true | ||
tags: [ "docs" ] | ||
categories: ["configuration"] | ||
doctypes: ["task"] | ||
--- | ||
|
||
## Overview | ||
|
||
The REST API includes a health endpoint to verify the status of NGINX Agent. | ||
|
||
## Configure the REST API | ||
|
||
To enable the REST API, add the following configuration to the NGINX Agent configuration file, `/etc/nginx-agent/nginx-agent.conf`: | ||
|
||
```nginx | ||
api: | ||
host: 127.0.0.1 | ||
port: 8038 | ||
``` | ||
|
||
## Using health checks | ||
|
||
After you enable the REST API, calling the `/health` endpoint returns the following JSON response: | ||
|
||
```json | ||
{ | ||
"status": "OK", | ||
"checks": [ | ||
{ | ||
"name": "registration", | ||
"status": "OK" | ||
}, | ||
{ | ||
"name": "commandConnection", | ||
"status": "OK" | ||
}, | ||
{ | ||
"name": "metricsConnection", | ||
"status": "OK" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
The top-level `status` field is the overall health status of NGINX Agent. The health status can return three different states: | ||
|
||
1. `PENDING`: NGINX Agent is still determining its health status. | ||
2. `OK`: NGINX Agent is in a healthy state. | ||
3. `ERROR`: NGINX Agent is in an unhealthy state. | ||
|
||
The health checkpoint performs three checks to determine the overall health of the NGINX Agent: | ||
|
||
1. `registration`: Checks if NGINX Agent has successfully registered with the management plane server. | ||
2. `commandConnection`: Checks if NGINX Agent is still able to receive and send commands. | ||
3. `metricsConnection`: Checks if NGINX Agent is still able to send metric reports. | ||
|
||
If any of the checks are in an `ERROR` status, then the overall status of NGINX Agent will change to `ERROR` as well. | ||
|