Package io.opentelemetry.api.metrics
Class DefaultMeter
- java.lang.Object
-
- io.opentelemetry.api.metrics.DefaultMeter
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description private static MeterINSTANCEprivate static BatchCallbackNOOP_BATCH_CALLBACKprivate static DoubleGaugeBuilderNOOP_DOUBLE_GAUGE_BUILDERprivate static DoubleHistogramBuilderNOOP_DOUBLE_HISTOGRAM_BUILDERprivate static LongCounterBuilderNOOP_LONG_COUNTER_BUILDERprivate static LongUpDownCounterBuilderNOOP_LONG_UP_DOWN_COUNTER_BUILDERprivate static ObservableDoubleMeasurementNOOP_OBSERVABLE_DOUBLE_MEASUREMENTprivate static ObservableLongMeasurementNOOP_OBSERVABLE_LONG_MEASUREMENT
-
Constructor Summary
Constructors Modifier Constructor Description privateDefaultMeter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BatchCallbackbatchCallback(java.lang.Runnable callback, ObservableMeasurement observableMeasurement, ObservableMeasurement... additionalMeasurements)Constructs a batch callback.LongCounterBuildercounterBuilder(java.lang.String name)Constructs a Counter instrument.DoubleGaugeBuildergaugeBuilder(java.lang.String name)Constructs an Asynchronous Gauge instrument.(package private) static MetergetInstance()DoubleHistogramBuilderhistogramBuilder(java.lang.String name)Constructs a Histogram instrument.LongUpDownCounterBuilderupDownCounterBuilder(java.lang.String name)Constructs an UpDownCounter instrument.
-
-
-
Field Detail
-
INSTANCE
private static final Meter INSTANCE
-
NOOP_LONG_COUNTER_BUILDER
private static final LongCounterBuilder NOOP_LONG_COUNTER_BUILDER
-
NOOP_LONG_UP_DOWN_COUNTER_BUILDER
private static final LongUpDownCounterBuilder NOOP_LONG_UP_DOWN_COUNTER_BUILDER
-
NOOP_DOUBLE_HISTOGRAM_BUILDER
private static final DoubleHistogramBuilder NOOP_DOUBLE_HISTOGRAM_BUILDER
-
NOOP_DOUBLE_GAUGE_BUILDER
private static final DoubleGaugeBuilder NOOP_DOUBLE_GAUGE_BUILDER
-
NOOP_BATCH_CALLBACK
private static final BatchCallback NOOP_BATCH_CALLBACK
-
NOOP_OBSERVABLE_DOUBLE_MEASUREMENT
private static final ObservableDoubleMeasurement NOOP_OBSERVABLE_DOUBLE_MEASUREMENT
-
NOOP_OBSERVABLE_LONG_MEASUREMENT
private static final ObservableLongMeasurement NOOP_OBSERVABLE_LONG_MEASUREMENT
-
-
Method Detail
-
getInstance
static Meter getInstance()
-
counterBuilder
public LongCounterBuilder counterBuilder(java.lang.String name)
Description copied from interface:MeterConstructs a Counter instrument.This is used to build both synchronous instruments and asynchronous instruments (i.e. callbacks).
- Specified by:
counterBuilderin interfaceMeter- Parameters:
name- the name of the Counter. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.- Returns:
- a builder for configuring a Counter instrument. Defaults to recording long values, but may be changed.
- See Also:
- Instrument Naming Rule
-
upDownCounterBuilder
public LongUpDownCounterBuilder upDownCounterBuilder(java.lang.String name)
Description copied from interface:MeterConstructs an UpDownCounter instrument.This is used to build both synchronous instruments and asynchronous instruments (i.e. callbacks).
- Specified by:
upDownCounterBuilderin interfaceMeter- Parameters:
name- the name of the UpDownCounter. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.- Returns:
- a builder for configuring an UpDownCounter instrument. Defaults to recording long values, but may be changed.
- See Also:
- Instrument Naming Rule
-
histogramBuilder
public DoubleHistogramBuilder histogramBuilder(java.lang.String name)
Description copied from interface:MeterConstructs a Histogram instrument.- Specified by:
histogramBuilderin interfaceMeter- Parameters:
name- the name of the Histogram. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.- Returns:
- a builder for configuring a Histogram synchronous instrument. Defaults to recording double values, but may be changed.
- See Also:
- Instrument Naming Rule
-
gaugeBuilder
public DoubleGaugeBuilder gaugeBuilder(java.lang.String name)
Description copied from interface:MeterConstructs an Asynchronous Gauge instrument.- Specified by:
gaugeBuilderin interfaceMeter- Parameters:
name- the name of the Gauge. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.- Returns:
- a builder used for configuring a Gauge instrument. Defaults to recording double values, but may be changed.
- See Also:
- Instrument Naming Rule
-
batchCallback
public BatchCallback batchCallback(java.lang.Runnable callback, ObservableMeasurement observableMeasurement, ObservableMeasurement... additionalMeasurements)
Description copied from interface:MeterConstructs a batch callback.Batch callbacks allow a single callback to observe measurements for multiple asynchronous instruments.
The callback will be called when the instruments are being observed.
Callbacks are expected to abide by the following restrictions:
- Run in a finite amount of time.
- Safe to call repeatedly, across multiple threads.
- Only observe values to registered instruments (i.e.
observableMeasurementandadditionalMeasurements
- Specified by:
batchCallbackin interfaceMeter- Parameters:
callback- a callback used to observe values on-demand.observableMeasurement- Instruments for which the callback may observe values.additionalMeasurements- Instruments for which the callback may observe values.
-
-