Interface: MetricGauge
common.MetricGauge
A metric that supports setting values.
The Metric API is an experimental feature and may be subject to change.
Hierarchy
-
↳
MetricGauge
Properties
description
• Optional
description: string
The description of the metric, if any.
Inherited from
name
• name: string
The name of the metric.
Inherited from
unit
• Optional
unit: string
The unit of the metric, if any.
Inherited from
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
Name | Type | Description |
---|---|---|
value | number | Value to set. |
extraTags? | MetricTags | Extra tags if any. |
Returns
void
withTags
▸ withTags(tags
): MetricGauge
Return a clone of this gauge, with additional tags.
Parameters
Name | Type | Description |
---|---|---|
tags | MetricTags | Tags to append to existing tags. |