name | metrics type | label |
---|---|---|
winston_events_total | counter | level |
e.g.
# HELP winston_events_total Number of logging events that made it to the logs
# TYPE winston_events_total counter
winston_events_total{level="info"} 3
winston-transport-prometheus can be used in the same way as the winston's standard transports.
*Please refer to the examples directory for more details
e.g.
import winston from 'winston';
import { PrometheusTransport } from '@matsumana/winston-transport-prometheus';
const logger = winston.createLogger({
level: 'info',
format: winston.format.simple(),
transports: [new winston.transports.Console(), new PrometheusTransport()],
});
PrometheusTransport's options as follows.
const myRegister = new Registry();
const prometheusTransport = new PrometheusTransport({ register: myRegister });
const logger = winston.createLogger({
level: 'info',
format: winston.format.simple(),
transports: [new winston.transports.Console(), prometheusTransport],
});
$ yarn fix
$ yarn lint
$ yarn test
$ yarn build