# @tinkoff/measure-fastify-requests

> Measure express requests

Latest version **0.5.5** (published 2026-03-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @tinkoff/measure-fastify-requests
pnpm add @tinkoff/measure-fastify-requests
yarn add @tinkoff/measure-fastify-requests
bun add @tinkoff/measure-fastify-requests
```

## Health

**Score 60/100 (C)** — status: stable.

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

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.5 |
| Published | 2026-03-17 |
| First published | 2022-04-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 130 |
| Maintainers | tinkoffbank, dmitry-korolev, yeahga, hondasmx, makar_l, rouland, ishivan, ytsareva, shoom3301, waterplea, meskill, marsibarsi, zig-green, super_oleg, dersizes, alexkvak, sradyukov |

## Links

- npm: https://www.npmjs.com/package/@tinkoff/measure-fastify-requests
- Repository: https://github.com/tramvaijs/tramvai
- Homepage: https://github.com/tramvaijs/tramvai#readme
- Issues: https://github.com/tramvaijs/tramvai/issues
- npm.io page: https://npm.io/package/@tinkoff/measure-fastify-requests

## Dependencies (4)

- [tslib](https://npm.io/package/tslib.md) ^2.4.0
- [@tinkoff/utils](https://npm.io/package/@tinkoff/utils.md) ^2.1.3
- [fastify-plugin](https://npm.io/package/fastify-plugin.md) ^5.1.0
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^0.1.12

## Recent versions

- 0.5.5 (latest) — 2026-03-17
- 0.6.1 (prerelease) — 2025-12-26
- 0.4.9 (stable-v5.x.x) — 2025-12-26
- 0.3.5 (stable-v4.x.x) — 2025-09-19
- 0.5.4 — 2025-12-26
- 0.5.3 — 2025-12-25
- 0.5.2 — 2025-12-18
- 0.4.8 — 2025-12-18
- 0.4.7 — 2025-11-19
- 0.4.6 — 2025-09-23
- 0.4.5 — 2025-09-16
- 0.5.1 — 2025-09-16
- 0.4.4 — 2025-03-25
- 0.4.3 — 2025-02-25
- 0.3.3 — 2024-10-17
- … 18 more at https://npm.io/package/@tinkoff/measure-fastify-requests/versions

## README

# @tinkoff/measure-fastify-requests

Library for measuring RED metrics in the fastify app

## Example

```ts
import fastify from 'fastify';
import { fastifyMeasureRequests } from '@tinkoff/measure-fastify-requests';
import { Counter, Histogram } from 'prom-client';

const app = fastify();

app.register(fastifyMeasureRequests, {
  metrics: {
    counter: (opt) => new Counter(opt),
    histogram: (opt) => new Histogram(opt),
  },
});
```

In the prom-client registry new metrics will be available:

- `http_requests_total` - number of incoming requests;
- `http_requests_errors` - number of errors in the incoming requests;
- `http_requests_execution_time` - histogram with the request handler execution time.
- `http_requests_first_byte_time` - histogram with the request handler first byte sent time.

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