1.0.3 • Published 2 years ago

@matsumana/winston-transport-prometheus v1.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

winston transport for Prometheus

npm version npm bundle size Dependencies npm downloads

CircleCI Known Vulnerabilities

Exported metrics

namemetrics typelabel
winston_events_totalcounterlevel

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

Usage

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 fix

run lint using prettier and eslint

$ yarn lint

run tests

$ yarn test

build

$ yarn build
1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago