Package io.opentelemetry.api.metrics
Interface Meter
@ThreadSafe
public interface Meter
Provides instruments used to produce metrics.
Instruments are obtained through builders provided by this interface. Each builder has a default "type" associated with recordings that may be changed.
A Meter is generally associated with an instrumentation library, e.g. "I monitor apache httpclient".
-
Method Summary
Modifier and TypeMethodDescriptioncounterBuilder
(String name) Constructs a counter instrument.gaugeBuilder
(String name) Constructs an asynchronous gauge.histogramBuilder
(String name) Constructs a Histogram instrument.upDownCounterBuilder
(String name) Constructs an up-down-counter instrument.
-
Method Details
-
counterBuilder
Constructs a counter instrument.This is used to build both synchronous (in-context) instruments and asynchronous (callback) instruments.
- Parameters:
name
- the name used for the counter.- Returns:
- a builder for configuring a new Counter instrument. Defaults to recording long values, but may be changed.
-
upDownCounterBuilder
Constructs an up-down-counter instrument.This is used to build both synchronous (in-context) instruments and asynchronous (callback) instruments.
- Parameters:
name
- the name used for the counter.- Returns:
- a builder for configuring a new Counter synchronous instrument. Defaults to recording long values, but may be changed.
-
histogramBuilder
Constructs a Histogram instrument.- Parameters:
name
- the name used for the counter.- Returns:
- a builder for configuring a new Histogram synchronous instrument. Defaults to recording double values, but may be changed.
-
gaugeBuilder
Constructs an asynchronous gauge.- Returns:
- a builder used for configuring how to report gauge measurements on demand.
-