Skip to main content

Endpoint

GET /health

Description

Returns the health status of the API Gateway and its dependencies. This endpoint is used for monitoring, load balancers, and orchestration tools to ensure the service is running correctly.

Authentication

No authentication required.

Response

The health check validates connectivity to critical dependencies, including RabbitMQ.
status
string
Overall health status of the serviceValues: ok, error, shutting_down
info
object
Detailed information about healthy services
error
object
Details about services that failed health checks (only present when status is error)
details
object
Complete details of all health indicators checked

Example Request

curl http://localhost:8000/health

Example Response

200 Healthy
{
  "status": "ok",
  "info": {
    "rabbitmq": {
      "status": "up"
    }
  },
  "error": {},
  "details": {
    "rabbitmq": {
      "status": "up"
    }
  }
}
503 Unhealthy
{
  "status": "error",
  "info": {},
  "error": {
    "rabbitmq": {
      "status": "down",
      "message": "Connection refused"
    }
  },
  "details": {
    "rabbitmq": {
      "status": "down",
      "message": "Connection refused"
    }
  }
}

Use in Monitoring

This endpoint can be used for:
  • Kubernetes/Docker: Liveness and readiness probes
  • Load Balancers: Health check configuration
  • Monitoring Tools: Uptime monitoring (Prometheus, Datadog, etc.)
  • CI/CD: Verify service health after deployment

Kubernetes Example

livenessProbe:
  httpGet:
    path: /health
    port: 8000
  initialDelaySeconds: 10
  periodSeconds: 30

readinessProbe:
  httpGet:
    path: /health
    port: 8000
  initialDelaySeconds: 5
  periodSeconds: 10

Notes

  • Returns HTTP 200 when all checks pass
  • Returns HTTP 503 when any dependency is unhealthy
  • RabbitMQ connectivity is verified by attempting a ping to the message broker
  • Response time should be monitored - slow responses may indicate degraded performance

Build docs developers (and LLMs) love