Enabling health checks
Health checks are disabled by default. Enable them using environment variables or CLI flags:| Environment variable | CLI flag | Default | Description |
|---|---|---|---|
BATON_HEALTH_CHECK | --health-check | false | Enable the health check server |
BATON_HEALTH_CHECK_PORT | --health-check-port | 8081 | Port for the health check server |
BATON_HEALTH_CHECK_BIND_ADDRESS | --health-check-bind-address | 127.0.0.1 | Bind address for the health check server |
Health check endpoints
| Endpoint | Description | Success (HTTP 200) | Failure (HTTP 503) |
|---|---|---|---|
/health | Full health check - calls the connector’s Validate() method | Connector is healthy | Connector validation failed |
/ready | Readiness check - verifies connector client is available | Connector is ready to serve requests | Connector client not available |
/live | Liveness check - verifies process is running | Always returns success | N/A |
The health-check command
Each connector includes ahealth-check subcommand for querying the health check server. This is designed for container exec probes, eliminating the need to bundle curl or other HTTP clients in container images.
Usage
Flags
| Flag | Default | Description |
|---|---|---|
--endpoint | health | Endpoint to check: health, ready, or live |
--timeout | 5 | Request timeout in seconds |
--health-check-port | 8081 | Port to connect to |
--health-check-bind-address | 127.0.0.1 | Address to connect to |
Exit codes
| Scenario | Exit code |
|---|---|
| HTTP 200 response | 0 (success) |
| HTTP non-200 response | 1 (failure) |
| Connection failed | 1 (failure) |
| Timeout | 1 (failure) |