5.21.2 Prometheus server health check
- Description
-
Perform a health check on the Prometheus server.
The status code always returns 200.
- Format
-
- Request line
GET /-/healthy HTTP/1.1
- Request header
-
Header Name
Setting Value
Host
Specify the information of the host of the Prometheus server to which the API is connected as a header value in the following format.
host-name-or-IP-address:port-number
":port-number" is optional.
-
host-name-or-IP-address
Specify the host name or IPv4 address of the Prometheus server.
-
port-number
Specify the port number to use when connecting to the Prometheus server.
This header is optional.
-
- Request message body
-
None
- Status codes
-
Always return 200.
- Examples
-
The following is an example of using this API using the OSS curl command.
If the Prometheus server is working properly:
>curl -I --request GET "http://localhost:20713/-/healthy" HTTP/1.1 200 OK Date: Sat, 07 Aug 2021 01:20:57 GMT Content-Length: 23 Content-Type: text/plain; charset=utf-8 >
If the Prometheus server is not working properly:
>curl -I --request GET "http://localhost:20713/-/healthy" curl: (7) Failed to connect to localhost port 20713: Connection refused >