Health Probes
Kubernetes-style health probe endpoints for monitoring state of the service.
The following are the health probe endpoints that can be used on platforms such as Kubernetes.
| Endpoint | Purpose |
|---|
Liveness (/live) | Indicates that the service can handle HTTP requests. |
Readiness (/ready) | Indicates that the service is initialized and ready to serve requests. |
Health (/health) | Indicates that the service is running and all components are functioning properly. |
1 - Liveness Probe
Indicates that the service is running and can handle HTTP requests.
Method
GET
URL
http://{Host Address}/live
Used by Kubernetes as a liveness probe.
Query Parameters
None
Sample Request
curl -X GET "http://<Host_address>/live"
import requests
url = "http://<Host_address>/live"
response = requests.get(url, verify=False)
print("Status code:", response.status_code)
URL: GET `http: //<Host_address>/live`
Response Codes
| Code | Description |
|---|
| 204 | Service can handle requests. |
2 - Readiness Probe
Indicates the service is initialized and ready to serve requests.
Method
GET
URL
http://{Host Address}/ready
This is used by Kubernetes as a readiness probe.
Query Parameters
None
Sample Request
curl -X GET "http://<Host_address>/ready"
import requests
url = "http://<Host_address>/ready"
response = requests.get(url, verify=False)
print("Status code:", response.status_code)
URL: GET `http: //<Host_address>/ready`
Response Codes
| Code | Description |
|---|
| 204 | Service is fully initialized and can handle requests. |
| 503 | Service is not yet ready to serve requests. |
3 - Health Check
Indicates that the service is running and all components are functioning correctly.
Method
GET
URL
http://{Host Address}/health
Returns service health status including individual component-level checks.
Query Parameters
None
Sample Request
curl -X GET "http://<Host_address>/health"
import requests
url = "http://<Host_address>/health"
response = requests.get(url, verify=False)
print("Status code:", response.status_code)
try:
print("Response JSON:", response.json())
except ValueError:
print("Response Text:", response.text)
URL: GET `http: //<Host_address>/health`
Sample Response
{
"isHealthy": true,
"checks": [
{
"isHealthy": true,
"output": {
"isHealthy": true,
"checks": [
{
"passed": true,
"output": "Pattern Classifier found",
"componentType": "engine",
"componentName": "Pattern Classifier"
},
{
"passed": true,
"output": "Pattern Classifier engine initialized",
"componentType": "engine",
"componentName": "Pattern Classifier"
},
{
"passed": true,
"output": "Dummy classification is responsive",
"componentType": "engine",
"componentName": "Pattern Classifier"
}
]
},
"componentType": "classification-provider",
"componentName": "Pattern"
},
{
"isHealthy": true,
"output": {
"isHealthy": true,
"checks": [
{
"passed": true,
"output": "PII Classifier model initialized",
"componentType": "model",
"componentName": "PII Classifier"
},
{
"passed": true,
"output": "Dummy classification is responsive",
"componentType": "engine",
"componentName": "Context Classifier"
}
]
},
"componentType": "classification-provider",
"componentName": "Context"
}
]
}
Response Fields Description
| Name | Type | Description |
|---|
isHealthy | boolean | true if all components are functioning properly. |
checks | array | List of component health checks. |
checks[].isHealthy | boolean | true if this component is healthy. |
checks[].componentType | string | Type of the component (e.g., classification-provider). |
checks[].componentName | string | Name of the component (e.g., Pattern). |
checks[].output | object | Detailed output for this component’s checks. |
checks[].output.isHealthy | boolean | true if all of this component’s internal checks passed. |
checks[].output.checks | array | List of individual sub-checks for this component. |
checks[].output.checks[].passed | boolean | true if this sub-check passed. |
checks[].output.checks[].output | string | Description of the sub-check result. |
checks[].output.checks[].componentType | string | Type of the element checked. |
checks[].output.checks[].componentName | string | Name of the element checked. |
Response Codes
| Code | Description |
|---|
| 200 | Service is running normally. |
| 503 | Service is unhealthy. Its components may be initializing or may need a restart. |