Skip to main content

Interface: MetricGauge

common.MetricGauge

A metric that supports setting values.

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

Hierarchy

Properties

description

Optional description: string

The description of the metric, if any.

Inherited from

Metric.description


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: NumericMetricValueType

The type of value to set. Either int or float.

Methods

set

set(value, extraTags?): void

Set the given value on the gauge.

Parameters

NameTypeDescription
valuenumberValue to set.
extraTags?MetricTagsExtra tags if any.

Returns

void


withTags

withTags(tags): MetricGauge

Return a clone of this gauge, with additional tags.

Parameters

NameTypeDescription
tagsMetricTagsTags to append to existing tags.

Returns

MetricGauge