Skip to main content

Interface: MetricGauge

Experimental

A metric that supports setting values.

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

Extends​

Properties​

description?​

optional description?: string

Experimental

The description of the metric, if any.

Inherited from​

Metric.description


kind​

kind: "gauge"

Experimental

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

Overrides​

Metric.kind


name​

name: string

Experimental

The name of the metric.

Inherited from​

Metric.name


unit?​

optional unit?: string

Experimental

The unit of the metric, if any.

Inherited from​

Metric.unit


valueType​

valueType: NumericMetricValueType

Experimental

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

Inherited from​

Metric.valueType

Methods​

set()​

set(value, extraTags?): void

Experimental

Set the given value on the gauge.

Parameters​

value​

number

Value to set.

extraTags?​

MetricTags

Extra tags if any.

Returns​

void


withTags()​

withTags(tags): MetricGauge

Experimental

Return a clone of this gauge, with additional tags.

Parameters​

tags​

MetricTags

Tags to append to existing tags.

Returns​

MetricGauge