- Add comprehensive 8-phase implementation plan (docs/plan.md) - Add 28 Architecture Decision Records (docs/adr/) covering all phases - Add task tracking system with 283+ task files (docs/stories/) - Add task generator script for automated task file creation - Add reference playbooks and requirements documentation This commit establishes the complete planning foundation for the Go Platform implementation, documenting all architectural decisions and providing detailed task breakdown for Phases 0-8.
1.6 KiB
1.6 KiB
ADR-0014: Health Check Implementation
Status
Accepted
Context
The platform needs health check endpoints for:
- Kubernetes liveness probes (
/healthz) - Kubernetes readiness probes (
/ready) - Monitoring and alerting
- Load balancer health checks
Health checks should be:
- Fast and lightweight
- Check critical dependencies (database, cache, etc.)
- Provide clear status indicators
Decision
Implement custom health check registry with composable checkers:
- Liveness endpoint (
/healthz): Always returns 200 if process is running - Readiness endpoint (
/ready): Checks all registered health checkers - Health check interface:
type HealthChecker interface { Check(ctx context.Context) error } - Registry pattern: Modules can register additional health checkers
Rationale:
- Custom implementation gives full control
- Composable design allows modules to add checks
- Simple interface is easy to test
- No external dependency for basic functionality
- Can extend with Prometheus metrics later
Consequences
Positive
- Lightweight and fast
- Extensible by modules
- Easy to test
- Clear separation of liveness vs readiness
Negative
- Need to implement ourselves (though simple)
- Must maintain the registry
Implementation Notes
- Create
pkg/health/health.gointerface - Implement
internal/health/registry.gowith checker map - Register core checkers: database, cache (if enabled)
- Add endpoints to HTTP router
- Return JSON response:
{"status": "ok", "checks": {...}} - Consider timeout (e.g., 5 seconds) for readiness checks