Skip to main content

Interface: MetricHistogram

Experimental

A metric that supports recording values on a histogram.

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: "histogram"

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​

record()​

record(value, extraTags?): void

Experimental

Record the given value on the histogram.

Parameters​

value​

number

Value to record. Must be a non-negative number. Value will be casted to the given valueType. Loss of precision may occur if the value is not already of the correct type.

extraTags?​

MetricTags

Extra tags if any.

Returns​

void


withTags()​

withTags(tags): MetricHistogram

Experimental

Return a clone of this histogram, with additional tags.

Parameters​

tags​

MetricTags

Tags to append to existing tags.

Returns​

MetricHistogram