mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-25 19:12:45 +00:00
feat: Add prometheus middleware to express
This enables collecting metrics from node.js and express.
This commit is contained in:
@@ -26,6 +26,7 @@ import {Express} from 'express';
|
||||
import morgan from 'morgan';
|
||||
import {join} from 'path';
|
||||
import {configFile, DEFAULT_TIMEOUT, isTestEnvironment, mailer, plugins, validator} from './common';
|
||||
import {getPrometheusMiddleware} from './middleware/prometheus';
|
||||
import {MailQueue} from './notification/mail-queue';
|
||||
import {bulkAddRouter} from './routes/bulk-add-route';
|
||||
import {bulkDoneRouter} from './routes/bulk-done-route';
|
||||
@@ -63,6 +64,10 @@ export async function configureApp(app: Express, databases: {[name: string]: Dat
|
||||
}, stream: process.stdout,
|
||||
}));
|
||||
|
||||
if (process.env.PROMETHEUS_MIDDLEWARE === 'true') {
|
||||
app.use(getPrometheusMiddleware());
|
||||
}
|
||||
|
||||
const corsOptions = {
|
||||
allowedHeaders: [
|
||||
'DNT',
|
||||
|
||||
Reference in New Issue
Block a user