HTTP Health Checks Configuration
Configure the health check probes and graceful shutdown behavior of the PowerTSM HTTP API.
Configuration Path
Section titled “Configuration Path”HAKOM:TSM:Http:HealthChecksConfiguration Structure
Section titled “Configuration Structure”HealthChecks└─ ShutdownTimeoutQuick Start
Section titled “Quick Start”Allow in-flight requests up to 30 seconds to complete during shutdown before the host forcefully terminates them:
<HAKOM> <TSM> <Http> <HealthChecks> <ShutdownTimeout>00:00:30</ShutdownTimeout> <!-- Default: 00:00:10 --> </HealthChecks> </Http> </TSM></HAKOM>Configuration Elements
Section titled “Configuration Elements”| Element | Type | Default | Required | Description |
|---|---|---|---|---|
ShutdownTimeout |
TimeSpan |
00:00:10 |
The maximum time the host waits for in-flight requests to complete after a stop signal is received before forcefully terminating. Specified in the format hh:mm:ss (10 seconds by default). |
Health Check Probes
Section titled “Health Check Probes”Health check probes are enabled out-of-the-box on every service. They let monitoring systems, load balancers and orchestrators (for example Kubernetes or Azure) determine whether an instance should receive traffic. Two endpoints are exposed:
| Endpoint | Purpose | Healthy | Unhealthy |
|---|---|---|---|
GET /health/live |
Liveness — the service process is up and running. | 200 OK |
503 Service Unavailable |
GET /health/ready |
Readiness — the service is ready to accept work. | 200 OK |
503 Service Unavailable |
The difference is subtle but important: a service can be live but not ready — for example, the process has started and is responding (alive), but a dependency it needs is still unavailable (not ready). Orchestrators typically use the liveness probe to decide whether to restart an instance, and the readiness probe to decide whether to route traffic to it.
Health Check Tags
Section titled “Health Check Tags”Each health check is assigned to one or both probes by means of two tags:
| Tag | Probe |
|---|---|
live |
A check tagged live is evaluated by /health/live. |
ready |
A check tagged ready is evaluated by /health/ready. |
A probe reports 200 OK only when all checks carrying its tag report healthy; otherwise it reports 503 Service Unavailable.
Out-of-the-box, every service registers a graceful shutdown health check that is tagged with both live and ready. While the service is running it reports healthy; once the host receives a stop signal it reports unhealthy, causing both probes to return 503. This lets upstream load balancers stop routing new traffic to the instance before it terminates.
Individual services can register additional checks and assign them to either probe using the live and ready tags.
Understanding Graceful Shutdown
Section titled “Understanding Graceful Shutdown”When the host receives a stop signal (for example SIGTERM from an orchestrator, or Ctrl+C in a console), it begins a graceful shutdown:
- The graceful shutdown health check starts reporting unhealthy, so
/health/liveand/health/readyreturn503and upstream load balancers stop sending new requests. - The host waits up to
ShutdownTimeoutfor requests that are already in progress to finish. - Once all in-flight requests complete — or the timeout elapses — the host terminates. Any requests still running when the timeout elapses are cut off.
Choose a ShutdownTimeout that gives your typical request long enough to complete, while staying within the grace period your orchestrator allows before it forcibly kills the process. If the platform’s termination grace period is shorter than ShutdownTimeout, the platform’s limit wins.