Skip to main content

Overview

Health check endpoints are used for monitoring, load balancers, and Kubernetes orchestration. These endpoints do not require authentication.

Basic Health Check

GET /health
Basic health check endpoint for load balancers and monitoring systems. Authentication: Not required

Response

{
  "status": "healthy",
  "timestamp": "2025-11-14T10:30:00.000000",
  "service": "stocks-trading-analysis"
}
HTTP Status: 200 OK

Detailed Health Check

GET /health/detailed
Comprehensive health check including database connectivity, environment variables, and disk space. Authentication: Not required

Response

{
  "status": "healthy",
  "timestamp": "2025-11-14T10:30:00.000000",
  "service": "stocks-trading-analysis",
  "checks": {
    "database": {
      "status": "healthy",
      "message": "Database connection successful"
    },
    "environment": {
      "status": "healthy",
      "message": "All required environment variables are set"
    },
    "disk_space": {
      "status": "healthy",
      "message": "Disk space OK: 45.23GB free"
    }
  }
}
HTTP Status:
  • 200 OK - All checks healthy
  • 503 Service Unavailable - One or more checks degraded

Readiness Check

GET /health/ready
Kubernetes readiness probe to determine if the application is ready to serve traffic. Authentication: Not required

Response

{
  "status": "ready",
  "timestamp": "2025-11-14T10:30:00.000000"
}
HTTP Status:
  • 200 OK - Application ready
  • 503 Service Unavailable - Application not ready

Liveness Check

GET /health/live
Kubernetes liveness probe to verify the application is running and responsive. Authentication: Not required

Response

{
  "status": "alive",
  "timestamp": "2025-11-14T10:30:00.000000"
}
HTTP Status: 200 OK

Use Cases

Load Balancers

Use /health endpoint for basic health checks

Kubernetes Probes

Use /health/ready and /health/live for orchestration

Monitoring

Use /health/detailed for comprehensive system monitoring

CI/CD Pipelines

Verify deployment health before routing traffic