5.21.1 Reload Prometheus server
- Description
-
Reloads Prometheus server definition files (jpc_prometheus_server.yml, jpc_alerting_rules.yml, file discovery definition files, etc.) and reflects them in the operation of Prometheus server.
Reloading the Prometheus server is faster than restarting the Prometheus server and maintains the state at the time of notification failure.
- Special Notes on API Operation
-
-
All definition fields are reloaded.
-
If you change the threshold of an alert rule and reload, the status of the alert changes to the status corresponding to the changed threshold.
-
If you reload an incorrect definition file, all definition entries will not be updated. It is recommended that you use the promtool check config command to check the format of the configuration file before reloading.
-
- Format
-
- Request line
POST /-/reload 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-addres
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
- Response message body
-
If the reload is successful, there is no response.
If the reload fails, a message (the value printed by the Prometheus server) is set indicating the cause of the failure.
- Status codes
-
Status code
Message
Description
200
OK
Reloaded successfully.
Other than 200
Other than OK
Reloaded successfully.
- Examples
-
The following is an example of using this API using the OSS curl command.
On successful reload:
>curl --request POST "http://localhost:20713/-/reload" >
On reload failure:
>curl --request POST "http://localhost:20713/-/reload" failed to reload config: couldn't load configuration (--config.file="C:\\jp1pccs\\conf\\jpc_prometheus_server.yml"): parsing YAML file C:\\jp1pccs\\conf\\jpc_prometheus_server.yml: yaml: unmarshal errors: line 10: field test not found in type config.plain >