Skip to main content

Interface: MetricUpDownCounter

common.MetricUpDownCounter

A metric that supports adding signed values as an up-down counter.

The Metric API is an experimental feature and may be subject to change.

Hierarchy

  • Metric

    MetricUpDownCounter

Properties

description

Optional description: string

The description of the metric, if any.

Inherited from

Metric.description


kind

kind: "up-down-counter"

The kind of the metric (e.g. counter, histogram, gauge).

Overrides

Metric.kind


name

name: string

The name of the metric.

Inherited from

Metric.name


unit

Optional unit: string

The unit of the metric, if any.

Inherited from

Metric.unit


valueType

valueType: "int"

The type of value recorded by the metric. Either int or float.

Overrides

Metric.valueType

Methods

add

add(value, extraTags?): void

Add the given value to the up-down counter. Value may be negative.

Parameters

NameTypeDescription
valuenumberValue to add (can be positive or negative).
extraTags?MetricTagsExtra tags if any.

Returns

void


withTags

withTags(tags): MetricUpDownCounter

Return a clone of this up-down counter, with additional tags.

Parameters

NameTypeDescription
tagsMetricTagsTags to append to existing tags.

Returns

MetricUpDownCounter