# @tcandrei/metrics-middleware

> prometheus metrics middleware

Latest version **1.0.2** (published 2020-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tcandrei/metrics-middleware
pnpm add @tcandrei/metrics-middleware
yarn add @tcandrei/metrics-middleware
bun add @tcandrei/metrics-middleware
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-03-12 |
| First published | 2020-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andrew Tsybin |
| Maintainers | tcandrei |

## Links

- npm: https://www.npmjs.com/package/@tcandrei/metrics-middleware
- Repository: https://github.com/tsybinAndrey/monorepo-example
- Homepage: https://github.com/tsybinAndrey/monorepo-example#readme
- Issues: https://github.com/tsybinAndrey/monorepo-example/issues
- npm.io page: https://npm.io/package/@tcandrei/metrics-middleware

## Dependencies (2)

- [prom-client](https://npm.io/package/prom-client.md) ^12.0.0
- [response-time](https://npm.io/package/response-time.md) ^2.3.2

## Recent versions

- 1.0.2 (latest) — 2020-03-12
- 1.0.1 — 2020-03-12
- 1.0.0 — 2020-03-07

## README

# `metrics-middleware`

prometheus based middleware to collect response-time metrics from express server app

## Usage

```
const express = require('express');
const metrics = require('@tcandrei/metrics-middleware');

const app = express();

app.use(metrics.metricsCollector('simple-express-server'));

metrics.expressMetricsRouteHandler(app, '/metrics');

app.get('/ping', ping);

app.use(notFound);

const server = app.listen(process.env.PORT || 3000, () => {
  console.log('Server is ready and listening...');
});


```

---
_Source: https://npm.io/package/@tcandrei/metrics-middleware · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
