# 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:
- Redis Connection
- Database Connection
- Worker Status
- Message Sync Status
## 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
1. `/healthz` - Basic server health check for Kubernetes pod monitoring
2. `/healthz/{serviceName}` - Individual service health checks (returns
200 if healthy)
3. `/metricsz/{metricName}` - Time-windowed metrics (message sync,
captcha)
4. GraphQL resolver in admin panel for UI consumption
All endpoints use the same underlying service, with different
presentation layers for infrastructure and UI needs.
---------
Co-authored-by: Félix Malfait <felix@twenty.com>
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import { SettingsAdminTabContent } from '@/settings/admin-panel/components/SettingsAdminTabContent';
|
|
import { SETTINGS_ADMIN_TABS } from '@/settings/admin-panel/constants/SettingsAdminTabs';
|
|
import { SETTINGS_ADMIN_TABS_ID } from '@/settings/admin-panel/constants/SettingsAdminTabsId';
|
|
import { TabList } from '@/ui/layout/tab/components/TabList';
|
|
import styled from '@emotion/styled';
|
|
import { IconHeart, IconSettings2, IconVariable } from 'twenty-ui';
|
|
|
|
const StyledTabListContainer = styled.div`
|
|
align-items: center;
|
|
border-bottom: ${({ theme }) => `1px solid ${theme.border.color.light}`};
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
`;
|
|
|
|
export const SettingsAdminContent = () => {
|
|
const tabs = [
|
|
{
|
|
id: SETTINGS_ADMIN_TABS.GENERAL,
|
|
title: 'General',
|
|
Icon: IconSettings2,
|
|
},
|
|
{
|
|
id: SETTINGS_ADMIN_TABS.ENV_VARIABLES,
|
|
title: 'Env Variables',
|
|
Icon: IconVariable,
|
|
},
|
|
{
|
|
id: SETTINGS_ADMIN_TABS.HEALTH_STATUS,
|
|
title: 'Health Status',
|
|
Icon: IconHeart,
|
|
},
|
|
];
|
|
|
|
return (
|
|
<>
|
|
<StyledTabListContainer>
|
|
<TabList
|
|
tabs={tabs}
|
|
tabListInstanceId={SETTINGS_ADMIN_TABS_ID}
|
|
behaveAsLinks={true}
|
|
/>
|
|
</StyledTabListContainer>
|
|
<SettingsAdminTabContent />
|
|
</>
|
|
);
|
|
};
|