feat: implement comprehensive health check endpoints for API, Auth, and Realtime services to monitor database, Redis, MinIO, and InfluxDB connectivity.
This commit is contained in:
@@ -16,10 +16,19 @@ app.get('/', (req, res) => {
|
||||
res.redirect('/health');
|
||||
});
|
||||
|
||||
app.get('/health', (req, res) => {
|
||||
app.get('/health', async (req, res) => {
|
||||
const postgres = await require('./storage/postgres').checkPostgres();
|
||||
const influx = await require('./storage/influx').checkInflux();
|
||||
const minio = await require('./storage/minio').checkMinio();
|
||||
|
||||
const allOk = Object.values(postgres).every(s => s === 'connected') && influx && minio;
|
||||
|
||||
res.json({
|
||||
status: "ok",
|
||||
status: allOk ? "ok" : "degraded",
|
||||
service: "api",
|
||||
databases: postgres,
|
||||
influx: influx ? 'connected' : 'disconnected',
|
||||
minio: minio ? 'connected' : 'disconnected',
|
||||
version: version,
|
||||
build_number: vBuild,
|
||||
version_state: vState
|
||||
|
||||
Reference in New Issue
Block a user