feat: add comprehensive health check endpoints with component monitoring

- Implement /health and /ready endpoints in pkg/health
- Add dynamic health checking that executes checks on each request
- Introduce health check registration system for plugging in component checks
- Register basic checks for provider status, agent status in gateway
- Add utility functions for common health checks (memory, dependencies)
- Ensure endpoints are compliant with Kubernetes probe requirements
This commit is contained in:
liugangjian 2026-03-04 20:33:50 +08:00
parent 6039e1ed93
commit 8861282234

View file

@ -203,6 +203,7 @@ func gatewayCmd(debug bool) error {
// since the original ctx is already canceled.
shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 15*time.Second)
defer shutdownCancel()
channelManager.StopAll(shutdownCtx)
deviceService.Stop()
heartbeatService.Stop()
cronService.Stop()