@tinkoff/measure-express-requests
TypeScript icon, indicating that this package has built-in type declarations

2.0.6 • Public • Published

@tinkoff/measure-express-requests

Library for measuring RED metrics in the express app

Example

import express from 'express';
import { measure } from '@tinkoff/measure-express-requests';
import { Counter, Histogram } from 'prom-client';

const app = express();

app.use(
  measure({
    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.

/@tinkoff/measure-express-requests/

    Package Sidebar

    Install

    npm i @tinkoff/measure-express-requests

    Weekly Downloads

    3

    Version

    2.0.6

    License

    Apache-2.0

    Unpacked Size

    6.86 kB

    Total Files

    5

    Last publish

    Collaborators

    • yeahga
    • sradyukov
    • hondasmx
    • makar_l
    • tinkoffbank
    • dmitry-korolev
    • rouland
    • ishivan
    • ytsareva
    • shoom3301
    • waterplea
    • meskill
    • marsibarsi
    • zig-green
    • super_oleg
    • dersizes
    • alexkvak