# @routup/prometheus

> Prometheus metrics plugin for routup.

Latest version **4.0.0** (published 2026-05-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @routup/prometheus
pnpm add @routup/prometheus
yarn add @routup/prometheus
bun add @routup/prometheus
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2026-05-20 |
| First published | 2023-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 21.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Peter Placzek |
| Maintainers | tada5hi |
| Keywords | metrics, prom, prometheus |

## Links

- npm: https://www.npmjs.com/package/@routup/prometheus
- Repository: https://github.com/routup/plugins
- Homepage: https://github.com/routup/plugins#readme
- Issues: https://github.com/routup/plugins/issues
- npm.io page: https://npm.io/package/@routup/prometheus

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2026-05-20
- 3.2.0 — 2026-05-12
- 3.1.0 — 2026-05-06
- 3.0.0 — 2026-05-05
- 2.4.2 — 2025-11-26
- 2.4.1 — 2025-06-25
- 2.4.0 — 2024-06-29
- 2.3.0 — 2023-11-21
- 2.2.0 — 2023-11-20
- 2.1.0 — 2023-10-22
- 2.0.0 — 2023-10-04
- 2.0.0-alpha.4 — 2023-10-04
- 2.0.0-alpha.1 — 2023-10-01
- 2.0.0-alpha.0 — 2023-09-30
- 1.0.2 — 2023-09-14
- … 13 more at https://npm.io/package/@routup/prometheus/versions

## README

# @routup/prometheus

[![npm version](https://badge.fury.io/js/@routup%2Fprometheus.svg)](https://badge.fury.io/js/@routup%2Fprometheus)
[![main](https://github.com/routup/plugins/actions/workflows/main.yml/badge.svg)](https://github.com/routup/plugins/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/routup/plugins/branch/master/graph/badge.svg)](https://codecov.io/gh/routup/plugins)
[![Known Vulnerabilities](https://snyk.io/test/github/routup/plugins/badge.svg)](https://snyk.io/test/github/routup/plugins)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)

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](https://www.npmjs.com/package/prom-client) library.

**Table of Contents**

- [Installation](#installation)
- [Documentation](#documentation)
- [Usage](#usage)
- [License](#license)

## Installation

```bash
npm install @routup/prometheus --save
```

## Documentation

To read the docs, visit [https://routup.net](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!

```typescript
import {
    App,
    serve,
} from 'routup';
import { prometheus } from '@routup/prometheus';

const router = new App();

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

serve(router, { port: 3000 });
```

## License

Made with 💚

Published under [MIT License](./LICENSE).

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