carlos-asg/tu-voz-en-ruta
Overview
This skill configures django-health-check for Django apps to expose monitoring endpoints, Docker HEALTHCHECKs, and Kubernetes liveness/readiness probes. It provides patterns for public-schema URL placement, built-in checks (database, migrations, cache), and how to add custom checks. The goal is reliable container orchestration, load-balancer routing, and external uptime monitoring.
How this skill works
It installs and registers django-health-check and its plugins so the app exposes /health/ (HTML or JSON) and component URLs like /health/db/ and /health/migrations/. Health checks run fast, non-authenticated validations (DB connectivity, pending migrations, cache/storage) and can register custom checks via BaseHealthCheckBackend. Docker and Kubernetes probe snippets call /health/ with short timeouts so orchestrators act on failures.
When to use it
- Deploying Django in Docker or Kubernetes and needing liveness/readiness probes
- Adding simple, machine-readable health endpoints for load balancers or uptime monitors
- Verifying DB connectivity and pending migrations in automated deployments
- Integrating monitoring systems (UptimeRobot, Prometheus via metrics)
- Multi-tenant apps that require public-schema health endpoints
Best practices
- Expose health endpoints in the public schema or routing layer so orchestration can reach them
- Keep checks lightweight and fast; avoid expensive queries or tenant-specific work
- Use database and migrations checks to detect schema drift early
- Add Docker HEALTHCHECK in the Dockerfile and match timeouts to app startup behavior
- Configure Kubernetes liveness vs readiness separately (restart vs remove from service) with conservative initialDelaySeconds
- Return JSON for programmatic checks and ensure endpoints require no authentication
Example use cases
- Add /health/ to the public URL conf so Kubernetes can probe without tenant middleware
- Use docker HEALTHCHECK CMD curl -f http://localhost:8000/health/ to mark unhealthy containers
- Register a custom TenantCountCheck to surface non-critical tenant warnings in CI or dashboards
- Monitor /health/?format=json with an external uptime service and alert on 500 or timeouts
- Combine /metrics/ (django-prometheus) and /health/ for both metrics and simple availability checks
FAQ
No. Health endpoints must be publicly reachable by orchestrators and monitors; keep them unauthenticated and lightweight.
Where should I place health URLs in a multi-tenant app?
Put health URLs in the public schema URL conf (PUBLIC_SCHEMA_URLCONF) so Docker and Kubernetes can reach them without tenant routing.
4 skills
This skill helps you implement and validate django-health-check configurations for reliable health endpoints in Django deployments.
This skill enforces Django CBV best practices and type-safe forms, improving maintainability, security, and scalability across views, URLs, and commands.
This skill helps developers build modern, interactive Django apps using HTMX with class-based views for seamless partial updates and reduced JavaScript.
This skill helps you render interactive Chart.js graphs in Django templates by wiring data via data-* attributes and datalabels.