Skip to main content

Interface: MetricMeter

Experimental

A meter for creating metrics to record values on.

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

Methods​

createCounter()​

createCounter(name, unit?, description?): MetricCounter

Experimental

Create a new counter metric that supports adding values.

Parameters​

name​

string

Name for the counter metric.

unit?​

string

Unit for the counter metric. Optional.

description?​

string

Description for the counter metric. Optional.

Returns​

MetricCounter


createGauge()​

createGauge(name, valueType?, unit?, description?): MetricGauge

Experimental

Create a new gauge metric that supports setting values.

Parameters​

name​

string

Name for the gauge metric.

valueType?​

NumericMetricValueType

Type of value to set. Defaults to int.

unit?​

string

Unit for the gauge metric. Optional.

description?​

string

Description for the gauge metric. Optional.

Returns​

MetricGauge


createHistogram()​

createHistogram(name, valueType?, unit?, description?): MetricHistogram

Experimental

Create a new histogram metric that supports recording values.

Parameters​

name​

string

Name for the histogram metric.

valueType?​

NumericMetricValueType

Type of value to record. Defaults to int.

unit?​

string

Unit for the histogram metric. Optional.

description?​

string

Description for the histogram metric. Optional.

Returns​

MetricHistogram


createUpDownCounter()?​

optional createUpDownCounter(name, unit?, description?): MetricUpDownCounter

Experimental

Create a new up-down counter metric that supports adding signed values.

Parameters​

name​

string

Name for the up-down counter metric.

unit?​

string

Unit for the up-down counter metric. Optional.

description?​

string

Description for the up-down counter metric. Optional.

Returns​

MetricUpDownCounter


withTags()​

withTags(tags): MetricMeter

Experimental

Return a clone of this meter, with additional tags. All metrics created off the meter will have the tags.

Parameters​

tags​

MetricTags

Tags to append.

Returns​

MetricMeter