Anaconda OpenTelemetry for Typescript
    Preparing search index...

    Function decrementCounter

    • Decrements the specified counter by a given value.

      Parameters

      • args: CounterArgs

        An argument list object where the name field is required.

        The args is an object defined by (in any order):

        {
        name: string = ""; Required; Not supplying a name will result in no value being recorded.
        by?: number = 1; Optional; Not supplying this field will result in the counter being incremented by `1`.
        forceUpDownCounter?: boolean = true; Optional; Reguardless of this value, an up down counter will be created.
        attributes?: AttrMap = {}; Optional; Attributes for the counter metric.
        }

      Returns boolean

      true if the counter was decremented successfully, false if metrics are not initialized.

      // Creates an up down counter set to -2, or decrements the already created counter by `2`.
      decrementCounter({name: "validName", by: 2, attributes: {"name": "value"}})