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