Function counter

  • Parameters

    Returns ((proto, key) => void)

      • (proto, key): void
      • Parameters

        • proto: any
        • key: string

        Returns void

    Example

    import { counter, Counter } from '@biorate/prometheus';

    class Test {
    @counter({
    name: 'test_counter',
    help: 'Test counter',
    labelNames: ['label1', 'label2'],
    })
    protected counter: Counter;

    public metric() {
    this.counter.labels({ label1: 1, label2: 2 }).inc();
    }
    }

    const test = new Test();

    test.metric();

Generated using TypeDoc