|
|
Health Checking
Intelligent Agent offers two different endpoints that can be used to check the health of a website instance: /system/health/ and /system/status/
Note: these endpoints are unauthenticated. Anyone with access to your website will be able to request them by default.
The /system/health/ endpoint is designed primarily for simple and rapid testers like that used for a load balancer. It returns either an HTTP 200 response with the text "OK" if the website instance is operating normally, or an HTTP 503 response with a descriptive string of the encountered error type if not. Its test is against core functionality: is the database accessible, is the Redis cache accessible, do the website instance and database agree on the Intelligent Agent version number, and (if enabled) can the Awaken Intelligence licensing server be reached via the configured proxy.
The /system/status/ endpoint is instead designed to be a more verbose and granular report both of the current website and the System as a whole. It will return an HTTP 200 response if the core website functionality is operable, or an HTTP 500 response if there is a substantial problem.
An example of the response structure is shown below:
{
"Web": {
"InstanceId": "bf89e5d4-c813-42e0-9ee3-d8fd8fcb8391", // The current website instance's ID
"Version": "6.0.59.58916", // The current website instance's Intelligent Agent version
"Connection": {
"Status": true, // Whether the current website is communicative
"Time": 0 // Milliseconds taken to perform this test
},
"OpenSockets": 1,
"ActiveSessions": 1,
"ProxyStatus": {
"Configured": false,
"Status": true
},
"Addons": [
{
"Id": "14787217-ebb4-4885-a8ee-4d97be481369",
"Name": "SystemCleanup"
}
],
"Plugins": [
{
"Name": "SystemPlugin_GetExternalCampaignsText", // This will be the internal name for the Plugin
"Active": true
}
],
"Services": [
{
"Id": "dce9f706-636f-4459-bb85-cb47be0e7686",
"Name": "CSEFCloudApi",
"Active": true,
"Version": "1.0.59.58916",
"Health": {
"IsHealthy": true,
"Message": "" // Individual Services that are running will display a simple string here if they are not running properly
}
}
]
},
"Database": {
"Version": "6.0.59.58916", // The database's Intelligent Agent version
"Connection": {
"Status": true,
"Time": 0 // Milliseconds taken to perform this test
},
"Write": {
"Status": true,
"Time": 17 // Milliseconds taken to perform this test
},
"Read": {
"Status": true,
"Time": 31 // Milliseconds taken to perform this test
}
},
"Redis": {
"Connection": {
"Status": true,
"Time": 0 // Milliseconds taken to perform this test
},
"Write": {
"Status": true,
"Time": 1 // Milliseconds taken to perform this test
},
"Read": {
"Status": true,
"Time": 8 // Milliseconds taken to perform this test
},
"NumberOfKeys": 29
},
"Error": "" // If any failure is detected, it will be described as a simple string here
}
|