Package io.opentelemetry.sdk.metrics
Class SdkDoubleUpDownCounter.SdkDoubleUpDownCounterBuilder
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.SdkDoubleUpDownCounter.SdkDoubleUpDownCounterBuilder
-
- All Implemented Interfaces:
ExtendedDoubleUpDownCounterBuilder,DoubleUpDownCounterBuilder
- Enclosing class:
- SdkDoubleUpDownCounter
static final class SdkDoubleUpDownCounter.SdkDoubleUpDownCounterBuilder extends java.lang.Object implements ExtendedDoubleUpDownCounterBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private InstrumentBuilderbuilder
-
Constructor Summary
Constructors Constructor Description SdkDoubleUpDownCounterBuilder(SdkMeter sdkMeter, java.lang.String name, java.lang.String description, java.lang.String unit, Advice.AdviceBuilder adviceBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleUpDownCounterbuild()Builds and returns an UpDownCounter instrument with the configuration.ObservableDoubleMeasurementbuildObserver()Build an observer for this instrument to observe values from aBatchCallback.ObservableDoubleUpDownCounterbuildWithCallback(java.util.function.Consumer<ObservableDoubleMeasurement> callback)Builds an Asynchronous UpDownCounter instrument with the given callback.ExtendedDoubleUpDownCounterBuildersetAttributesAdvice(java.util.List<AttributeKey<?>> attributes)Specify the attribute advice, which suggests the recommended set of attribute keys to be used for this up down counter.DoubleUpDownCounterBuildersetDescription(java.lang.String description)Sets the description for this instrument.DoubleUpDownCounterBuildersetUnit(java.lang.String unit)Sets the unit of measure for this instrument.java.lang.StringtoString()
-
-
-
Field Detail
-
builder
private final InstrumentBuilder builder
-
-
Constructor Detail
-
SdkDoubleUpDownCounterBuilder
SdkDoubleUpDownCounterBuilder(SdkMeter sdkMeter, java.lang.String name, java.lang.String description, java.lang.String unit, Advice.AdviceBuilder adviceBuilder)
-
-
Method Detail
-
setDescription
public DoubleUpDownCounterBuilder setDescription(java.lang.String description)
Description copied from interface:DoubleUpDownCounterBuilderSets the description for this instrument.- Specified by:
setDescriptionin interfaceDoubleUpDownCounterBuilder- Parameters:
description- The description.- See Also:
- Instrument Description
-
setUnit
public DoubleUpDownCounterBuilder setUnit(java.lang.String unit)
Description copied from interface:DoubleUpDownCounterBuilderSets the unit of measure for this instrument.- Specified by:
setUnitin interfaceDoubleUpDownCounterBuilder- Parameters:
unit- The unit. Instrument units must be 63 or fewer ASCII characters.- See Also:
- Instrument Unit
-
build
public DoubleUpDownCounter build()
Description copied from interface:DoubleUpDownCounterBuilderBuilds and returns an UpDownCounter instrument with the configuration.- Specified by:
buildin interfaceDoubleUpDownCounterBuilder- Returns:
- The UpDownCounter instrument.
-
buildWithCallback
public ObservableDoubleUpDownCounter buildWithCallback(java.util.function.Consumer<ObservableDoubleMeasurement> callback)
Description copied from interface:DoubleUpDownCounterBuilderBuilds an Asynchronous UpDownCounter instrument with the given callback.The callback will be called when the instrument is 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.
- Specified by:
buildWithCallbackin interfaceDoubleUpDownCounterBuilder- Parameters:
callback- A callback which observes measurements when invoked.
-
buildObserver
public ObservableDoubleMeasurement buildObserver()
Description copied from interface:DoubleUpDownCounterBuilderBuild an observer for this instrument to observe values from aBatchCallback.This observer MUST be registered when creating a
batchCallback, which records to it. Values observed outside registered callbacks are ignored.- Specified by:
buildObserverin interfaceDoubleUpDownCounterBuilder- Returns:
- an observable measurement that batch callbacks use to observe values.
-
setAttributesAdvice
public ExtendedDoubleUpDownCounterBuilder setAttributesAdvice(java.util.List<AttributeKey<?>> attributes)
Description copied from interface:ExtendedDoubleUpDownCounterBuilderSpecify the attribute advice, which suggests the recommended set of attribute keys to be used for this up down counter.- Specified by:
setAttributesAdvicein interfaceExtendedDoubleUpDownCounterBuilder
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-