@nodescript/metrics
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

Metrics

Collect metrics with simple and concise API.

Uses Mesh IoC.

Usage

  1. Use counters, gauges and histograms to collect metrics in your application.

    export class MyService {
    
        @metric()
        counter = new CounterMetric('my_service_counter_total', 'Total number of times something important happened.');
    
        doSomething() {
            // ...
            counter.incr();
        }
    
    }
  2. Generate a Prometheus report from all metrics defined in your mesh:

    const report = generateMetricsReport(mesh);

Readme

Keywords

none

Package Sidebar

Install

npm i @nodescript/metrics

Weekly Downloads

128

Version

1.3.1

License

ISC

Unpacked Size

34.3 kB

Total Files

35

Last publish

Collaborators

  • danielolaviobr
  • danilidonbeltran
  • christellevs
  • inca