Package io.opentelemetry.sdk.metrics
Interface Aggregation
-
- All Known Implementing Classes:
Base2ExponentialHistogramAggregation,DefaultAggregation,DropAggregation,ExplicitBucketHistogramAggregation,LastValueAggregation,SumAggregation
public interface AggregationConfigures how instrument measurements are combined into metrics.Aggregation provides a set of built-in aggregations via static methods.
- Since:
- 1.14.0
-
-
Method Summary
Static Methods Modifier and Type Method Description static Aggregationbase2ExponentialBucketHistogram()Aggregates measurements into a base-2MetricDataType.EXPONENTIAL_HISTOGRAMusing the defaultmaxBucketsandmaxScale.static Aggregationbase2ExponentialBucketHistogram(int maxBuckets, int maxScale)Aggregates measurements into a base-2MetricDataType.EXPONENTIAL_HISTOGRAM.static AggregationdefaultAggregation()Choose the default aggregation for theInstrumentType.static Aggregationdrop()Drops all measurements and don't export any metric.static AggregationexplicitBucketHistogram()Aggregates measurements into an explicit bucketMetricDataType.HISTOGRAMusing the default bucket boundaries.static AggregationexplicitBucketHistogram(java.util.List<java.lang.Double> bucketBoundaries)Aggregates measurements into an explicit bucketMetricDataType.HISTOGRAM.static AggregationlastValue()Records the last seen measurement as aMetricDataType.DOUBLE_GAUGEorMetricDataType.LONG_GAUGE.static Aggregationsum()Aggregates measurements into aMetricDataType.DOUBLE_SUMorMetricDataType.LONG_SUM.
-
-
-
Method Detail
-
drop
static Aggregation drop()
Drops all measurements and don't export any metric.
-
defaultAggregation
static Aggregation defaultAggregation()
Choose the default aggregation for theInstrumentType.
-
sum
static Aggregation sum()
Aggregates measurements into aMetricDataType.DOUBLE_SUMorMetricDataType.LONG_SUM.
-
lastValue
static Aggregation lastValue()
Records the last seen measurement as aMetricDataType.DOUBLE_GAUGEorMetricDataType.LONG_GAUGE.
-
explicitBucketHistogram
static Aggregation explicitBucketHistogram()
Aggregates measurements into an explicit bucketMetricDataType.HISTOGRAMusing the default bucket boundaries.
-
explicitBucketHistogram
static Aggregation explicitBucketHistogram(java.util.List<java.lang.Double> bucketBoundaries)
Aggregates measurements into an explicit bucketMetricDataType.HISTOGRAM.- Parameters:
bucketBoundaries- A list of (inclusive) upper bounds for the histogram. Should be in order from lowest to highest.
-
base2ExponentialBucketHistogram
static Aggregation base2ExponentialBucketHistogram()
Aggregates measurements into a base-2MetricDataType.EXPONENTIAL_HISTOGRAMusing the defaultmaxBucketsandmaxScale.- Since:
- 1.23.0
-
base2ExponentialBucketHistogram
static Aggregation base2ExponentialBucketHistogram(int maxBuckets, int maxScale)
Aggregates measurements into a base-2MetricDataType.EXPONENTIAL_HISTOGRAM.- Parameters:
maxBuckets- the max number of positive buckets and negative buckets (max total buckets is 2 *maxBuckets+ 1 zero bucket).maxScale- the maximum and initial scale. If measurements can't fit in a particular scale given themaxBuckets, the scale is reduced until the measurements can be accommodated. Setting maxScale may reduce the number of downscales. Additionally, the performance of computing bucket index is improved when scale is<= 0.- Since:
- 1.23.0
-
-