fix(#17): Implementiere /metrics Endpoint für Monitoring
Some checks are pending
Docker Test / test (push) Waiting to run
Some checks are pending
Docker Test / test (push) Waiting to run
This commit is contained in:
parent
1f831a6edc
commit
dada761d84
2 changed files with 77 additions and 0 deletions
|
|
@ -16,6 +16,23 @@ app.use(express.json());
|
|||
|
||||
app.get('/health', (_req, res) => res.json({ status: 'ok' }));
|
||||
|
||||
// Metrics endpoint
|
||||
app.get('/metrics', (_req, res) => {
|
||||
const uptime = process.uptime();
|
||||
const memoryUsage = process.memoryUsage();
|
||||
|
||||
res.json({
|
||||
uptime: uptime,
|
||||
memory: {
|
||||
rss: memoryUsage.rss,
|
||||
heapTotal: memoryUsage.heapTotal,
|
||||
heapUsed: memoryUsage.heapUsed,
|
||||
external: memoryUsage.external
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
});
|
||||
});
|
||||
|
||||
app.use('/auth', authRoutes);
|
||||
app.use('/requests', helpRequestRoutes);
|
||||
app.use('/offers', offerRoutes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue