Health checks
API information
The health
resource is managed by the Health API.
XPKit Portal
It is recommended configurations are created in XPKit Portal, rather than making direct API requests.
Service URLs
Region | URL |
---|---|
AMER | https://health.amer.xpkit.net |
APAC | https://health.apac.xpkit.net |
China | https://health.china.xpkit.cn |
EMEA | https://health.emea.xpkit.net |
OpenAPI Specification
Resource name | Documentation | Download |
---|---|---|
Application, Service | View | Link |
Example service
health check configuration
{
"service_name": "Registration website",
"endpoint": "https://registration.abc.com/healthcheck/",
"http_method": "GET",
"successful_status_codes": [
"200"
],
"alert_distribution_list": "registration-alert",
"status": {
"healthy": false,
"status_code": 500,
"error_message": "PostgreSQL server timeout",
"error_since": "2022-04-23T10:05:36Z",
"alert_sent": "2022-04-23T10:05:40Z"
}
}
Providing additional context data to the health checker
When in error state, if the service
endpoint returns a JSON response in the format below, the API will provide the error returned in any alerts (via an error_message personalisation tag):
{
"error": "Could not connect to PostgreSQL server at 10.100.0.90:5432"
}
Notes on service configurations
- The Health API pings defined
service
endpoints and reports on the status of the services every 5 minutes. - In XPKit Portal you can see the results of the
service
health checks. Additional configurations can be added there. - When a
service
enters an error state analert
is sent to the defined distribution list (if provided). - To prevent too many alerts being sent, once an
service
enters an error state, alerts are restricted to one send every 15 minutes until the error state is resolved. - The status key is generated by XPKit and will be ignored if provided in any CRUD requests.
Example application
check in configuration
{
"service_name": "Payment API server",
"request_frequency": 300,
"alert_distribution_list": "payment-alert",
"disable_alerts": true,
"token": "080db1a2-58e1-49a1-bb3c-8891206f3c4c",
"requests": [
"2021-04-29T12:56:32Z",
"2021-04-29T12:51:05Z"
],
"checked_in": true
}
Notes on application configurations
- In XPKit Portal you can see the status of
application
check ins. Additional configurations can be added there. - When an
application
enters an error state analert
is sent to the defined distribution list (if provided). - To prevent too many alerts being sent, once an
application
enters an error state, alerts are restricted to one send every 15 minutes until theapplication
checks in again. - The requests, checked_in and token keys are generated by XPKit and will be ignored if provided in any CRUD requests.
- You should use the token field and your XPKit Account ID to determine the endpoint you should use to make your check in requests to. URL structure:
https://health.{% base_domain %}/api/checkin/{% account_id %}/{% token %}/