[grade=B] DC-097+DC-092: Prometheus metrics export + dependency health checks
DC-097: Add /api/v1/metrics/prometheus endpoint returning standard Prometheus text exposition format. Includes uptime, request counts by status/method, error counts, business metrics, memory gauges. Public (no auth) for Prometheus scraping. DC-092: Already resolved by DC-075's system/health endpoint which checks disk space, memory, service health, and incidents. All 1540 tests pass.
This commit is contained in:
@@ -736,6 +736,12 @@ async function createApp() {
|
||||
ok(res, { metrics: metrics.getSummary() });
|
||||
});
|
||||
|
||||
// DC-097: Prometheus text-format endpoint for Grafana/Prometheus scraping
|
||||
apiRouter.get('/metrics/prometheus', (req, res) => {
|
||||
res.set('Content-Type', 'text/plain; version=0.0.4');
|
||||
res.send(metrics.toPrometheus());
|
||||
});
|
||||
|
||||
// Mount at /api/v1 (canonical, single version)
|
||||
app.use('/api/v1', apiRouter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user