2.3.0 • Published 6 months ago

@routup/prometheus v2.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@routup/prometheus

npm version main codecov Known Vulnerabilities Conventional Commits

This is a routup plugin to collect and serve metrics for prometheus.

It provides two built-in metrics:

  • uptime: This metric provides information about the total uptime of the http server.
  • requestDuration: This metric provides information about the duration of incoming requests.

The plugin is based on the prom-client library.

Table of Contents

Installation

npm install @routup/prometheus --save

Documentation

To read the docs, visit https://routup.net

Usage

The metrics collected in the following example, can be inspected on: http://localhost:3000/metrics

The plugin should be installed before registering any other plugins or routes!

import { createServer } from 'node:http';
import { createNodeDispatcher, Router } from 'routup';
import { prometheus } from '@routup/prometheus';

const router = new Router();

router.use(prometheus({
    // serve metrics on path /metrics
    metricsPath: '/metrics'
}));

const server = createServer(createNodeDispatcher(router));
server.listen(3000);

License

Made with 💚

Published under MIT License.

1.0.2

8 months ago

2.3.0

6 months ago

2.2.0

6 months ago

2.0.0-alpha.4

7 months ago

2.0.0-alpha.0

7 months ago

2.0.0-alpha.1

7 months ago

2.1.0

7 months ago

2.0.0

7 months ago

1.0.1

12 months ago

1.0.0

12 months ago

1.0.0-alpha.0

12 months ago

0.7.2

12 months ago

0.7.1

1 year ago

0.7.0

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago