bigbluebutton-Github/bigbluebutton-html5/imports/startup/server/prom-metrics/winstonPromTransport.js
germanocaumo a04fbc56e1 feat(html5): add error logs and redis prometheus metrics
New config: settings.private.prometheus.collectRedisMetrics disabled by default
2022-04-08 14:21:55 +00:00

20 lines
433 B
JavaScript

const Transport = require('winston-transport');
import { PrometheusAgent, METRIC_NAMES } from './index.js'
module.exports = class WinstonPromTransport extends Transport {
constructor(opts) {
super(opts);
}
log(info, callback) {
setImmediate(() => {
this.emit('logged', info);
});
PrometheusAgent.increment(METRIC_NAMES.METEOR_ERRORS_TOTAL, { errorMessage: info.message });
callback();
}
};