-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Health monitor status for admin panel #10186
Conversation
packages/twenty-server/src/engine/core-modules/health/health.controller.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/health.controller.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR implements a comprehensive health monitoring system for the admin panel, adding detailed status checks for core services and message synchronization with proper error handling and caching.
- Added three new health indicators in
/packages/twenty-server/src/engine/core-modules/health/indicators/
for database, Redis, and worker status monitoring - Implemented
/healthz/system-status
endpoint inhealth.controller.ts
returning detailed service statuses with typed responses - Added
HealthCacheService
with time-windowed monitoring for message sync jobs and invalid captcha attempts - Introduced worker health monitoring in
worker.health.ts
that checks active workers across all BullMQ queues - Added proper TypeScript types and enums in
/types
directory for consistent health status reporting
10 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-server/src/engine/core-modules/health/health.controller.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/enums/heath-service-status.enum.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/enums/heath-service-status.enum.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/health-cache.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/indicators/database.health.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/indicators/database.health.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/indicators/redis.health.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/indicators/redis.health.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/indicators/worker.health.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/types/health-service.types.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice ! I don't have all the context Felix and you can have. Feel free to ignore comment if it's not pertinent.
packages/twenty-server/src/engine/core-modules/health/controllers/health.controller.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel-health.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/controllers/health.controller.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/indicators/database.health.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/indicators/redis.health.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/health/indicators/worker.health.ts
Show resolved
Hide resolved
Thanks @ehconitin for your contribution! |
Health Monitoring for Self-Hosted Instances
This PR implements basic health monitoring for self-hosted instances in the admin panel.
Service Status Checks
We're adding real-time health checks for:
Existing Functionality
We already have message sync and captcha counters that store aggregated metrics in cache within a configurable time window (default: 5 minutes).
New Endpoints
/healthz
- Basic server health check for Kubernetes pod monitoring/healthz/{serviceName}
- Individual service health checks (returns 200 if healthy)/metricsz/{metricName}
- Time-windowed metrics (message sync, captcha)All endpoints use the same underlying service, with different presentation layers for infrastructure and UI needs.