2.0.0 • Published 1 year ago
@matsumana/winston-transport-prometheus v2.0.0
winston transport for Prometheus
Exported metrics
| 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"} 3Usage
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],
});How to run the commands for test and build
fix source files using prettier and eslint
$ yarn fixrun lint using prettier and eslint
$ yarn lintrun tests
$ yarn testbuild
$ yarn build