Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5847e5de11 |
+1
-1
@@ -5,5 +5,5 @@ COPY package.json ./
|
||||
RUN npm install --production
|
||||
COPY server.js ./
|
||||
EXPOSE 3100
|
||||
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD curl -sf http://localhost:3100/health || exit 1
|
||||
HEALTHCHECK --interval=30s --timeout=5s CMD curl -sf http://localhost:3100/health || exit 1
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
@@ -85,8 +85,8 @@ app.get('/resources', (req, res) => {
|
||||
|
||||
app.get('/services', async (req, res) => {
|
||||
const services = [
|
||||
{ name: 'litellm', url: 'http://litellm:4000/health/readiness', critical: true },
|
||||
{ name: 'letta', url: 'http://letta:8283/v1/health/', critical: false },
|
||||
{ name: 'litellm', url: 'http://litellm:4000/health', critical: true },
|
||||
{ name: 'letta', url: 'http://letta:8283/api/health', critical: false },
|
||||
{ name: 'n8n', url: 'http://n8n:5678/healthz', critical: true },
|
||||
{ name: 'gitea', url: 'http://gitea:3000/api/v1/version', critical: true },
|
||||
{ name: 'grafana', url: 'http://grafana:3000/api/health', critical: false },
|
||||
@@ -95,13 +95,12 @@ app.get('/services', async (req, res) => {
|
||||
const results = [];
|
||||
for (const svc of services) {
|
||||
const start = Date.now();
|
||||
const response = exec('curl -sf -m 5 ' + svc.url);
|
||||
results.push({
|
||||
name: svc.name,
|
||||
status: response ? 'healthy' : 'unreachable',
|
||||
response_ms: Date.now() - start,
|
||||
critical: svc.critical
|
||||
});
|
||||
try {
|
||||
const response = exec(`curl -sf -m 5 ${svc.url}`);
|
||||
results.push({ name: svc.name, status: response ? 'healthy' : 'unreachable', response_ms: Date.now() - start, critical: svc.critical });
|
||||
} catch {
|
||||
results.push({ name: svc.name, status: 'unreachable', response_ms: Date.now() - start, critical: svc.critical });
|
||||
}
|
||||
}
|
||||
const healthy = results.filter(r => r.status === 'healthy').length;
|
||||
res.json({
|
||||
@@ -114,5 +113,5 @@ app.get('/services', async (req, res) => {
|
||||
});
|
||||
|
||||
app.listen(PORT, '0.0.0.0', () => {
|
||||
console.log('APEX Status API v1.1 - connectivity fix applied');
|
||||
console.log(`APEX Status API running on port ${PORT}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user