Options
All
  • Public
  • Public/Protected
  • All
Menu

An interface to allow the recording metrics.

{@link Metric}s are used for recording pre-defined aggregation (Counter), or raw values (Histogram) in which the aggregation and attributes for the exported metric are deferred.

since

1.3.0

Hierarchy

  • Meter

Index

Methods

  • Sets up a function that will be called whenever a metric collection is initiated.

    If the function is already in the list of callbacks for this Observable, the function is not added a second time.

    Only the associated observables can be observed in the callback. Measurements of observables that are not associated observed in the callback are dropped.

    Type Parameters

    Parameters

    • callback: BatchObservableCallback<AttributesTypes>

      the batch observable callback

    • observables: Observable<AttributesTypes>[]

      the observables associated with this batch observable callback

    Returns void

  • Creates a new Counter metric. Generally, this kind of metric when the value is a quantity, the sum is of primary interest, and the event count and value distribution are not of primary interest.

    Type Parameters

    Parameters

    • name: string

      the name of the metric.

    • Optional options: MetricOptions

    Returns Counter<AttributesTypes>

  • createGauge<AttributesTypes>(name: string, options?: MetricOptions): Gauge<AttributesTypes>
  • Creates a new UpDownCounter metric. UpDownCounter is a synchronous instrument and very similar to Counter except that Add(increment) supports negative increments. It is generally useful for capturing changes in an amount of resources used, or any quantity that rises and falls during a request. Example uses for UpDownCounter:

    1. count the number of active requests.
    2. count memory in use by instrumenting new and delete.
    3. count queue size by instrumenting enqueue and dequeue.
    4. count semaphore up and down operations.

    Type Parameters

    Parameters

    • name: string

      the name of the metric.

    • Optional options: MetricOptions

    Returns UpDownCounter<AttributesTypes>

Generated using TypeDoc