Interface AggregatorFactory
-
@Immutable public interface AggregatorFactoryFactory class forAggregator.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static AggregatorFactorycount(AggregationTemporality temporality)Returns anAggregationFactorythat calculates count of recorded measurements (the number of recorded measurements).<T> Aggregator<T>create(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, InstrumentDescriptor descriptor)Returns a newAggregator.static AggregatorFactoryhistogram(List<Double> boundaries, AggregationTemporality temporality)Returns anAggregatorFactorythat calculates an approximation of the distribution of the measurements taken.static AggregatorFactorylastValue()Returns anAggregationFactorythat calculates the last value of all recorded measurements.static AggregatorFactoryminMaxSumCount()Returns anAggregationFactorythat calculates a simple summary of all recorded measurements.static AggregatorFactorysum(boolean alwaysCumulative)Returns anAggregationFactorythat calculates sum of recorded measurements.
-
-
-
Method Detail
-
sum
static AggregatorFactory sum(boolean alwaysCumulative)
Returns anAggregationFactorythat calculates sum of recorded measurements.This factory produces
Aggregatorthat will always produce Sum metrics, the monotonicity is determined based on the instrument type (for Counter and SumObserver will be monotonic, otherwise not).- Parameters:
alwaysCumulative- configures to always produceAggregationTemporality.CUMULATIVEiftrueORAggregationTemporality.DELTAfor all types except SumObserver and UpDownSumObserver which will always produceAggregationTemporality.CUMULATIVE.- Returns:
- an
AggregationFactorythat calculates sum of recorded measurements.
-
count
static AggregatorFactory count(AggregationTemporality temporality)
Returns anAggregationFactorythat calculates count of recorded measurements (the number of recorded measurements).This factory produces
Aggregatorthat will always produce monotonic Sum metrics independent of the instrument type. The sum represents the number of measurements recorded.- Parameters:
temporality- configures what temporality to be produced for the Sum metrics.- Returns:
- an
AggregationFactorythat calculates count of recorded measurements (the number of recorded * measurements).
-
lastValue
static AggregatorFactory lastValue()
Returns anAggregationFactorythat calculates the last value of all recorded measurements.This factory produces
Aggregatorthat will always produce gauge metrics independent of the instrument type.Limitation: The current implementation does not store a time when the value was recorded, so merging multiple LastValueAggregators will not preserve the ordering of records.
- Returns:
- an
AggregationFactorythat calculates the last value of all recorded measurements.
-
minMaxSumCount
static AggregatorFactory minMaxSumCount()
Returns anAggregationFactorythat calculates a simple summary of all recorded measurements. The summary consists of the count of measurements, the sum of all measurements, the maximum value recorded and the minimum value recorded.This factory produces
Aggregatorthat will always produce double summary metrics independent of the instrument type.- Returns:
- an
AggregationFactorythat calculates a simple summary of all recorded measurements.
-
histogram
static AggregatorFactory histogram(List<Double> boundaries, AggregationTemporality temporality)
Returns anAggregatorFactorythat calculates an approximation of the distribution of the measurements taken.- Parameters:
temporality- configures what temporality to be produced for the Histogram metrics.boundaries- configures the fixed bucket boundaries.- Returns:
- an
AggregationFactorythat calculates histogram of recorded measurements. - Since:
- 1.1.0
-
create
<T> Aggregator<T> create(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, InstrumentDescriptor descriptor)
Returns a newAggregator.- Parameters:
resource- the Resource associated with theInstrumentthat will record measurements.instrumentationLibraryInfo- the InstrumentationLibraryInfo associated with theInstrumentthat will record measurements.descriptor- the descriptor of theInstrumentthat will record measurements.- Returns:
- a new
Aggregator.
-
-