Class Aggregation


  • public abstract class Aggregation
    extends Object
    Configures how measurements are combined into metrics for Views.

    Aggregation provides a set of built-in aggregations via static methods.

    • Method Detail

      • config

        public abstract io.opentelemetry.sdk.metrics.internal.aggregator.AggregatorFactory config​(InstrumentDescriptor instrument)
        Returns the appropriate aggregator factory for a given instrument.
        Returns:
        The AggregatorFactory or null if none.
      • none

        public static Aggregation none()
        The None Aggregation will ignore/drop all Instrument Measurements.
      • defaultAggregation

        public static Aggregation defaultAggregation()
        The default aggregation for an instrument will be chosen.
      • sum

        public static Aggregation sum()
        Instrument measurements will be combined into a metric Sum.
      • lastValue

        public static Aggregation lastValue()
        Remembers the last seen measurement and reports as a Gauge.
      • explictBucketHistogram

        public static Aggregation explictBucketHistogram()
        Aggregates measurments into an explicit bucket histogram using the default bucket boundaries.
      • explictBucketHistogram

        public static Aggregation explictBucketHistogram​(AggregationTemporality temporality)
        Aggregates measurments into an explicit bucket histogram using the default bucket boundaries.
        Parameters:
        temporality - Whether to report DELTA or CUMULATIVE metrics.
      • explictBucketHistogram

        public static Aggregation explictBucketHistogram​(AggregationTemporality temporality,
                                                         List<Double> bucketBoundaries)
        Aggregates measurments into an explicit bucket histogram.
        Parameters:
        temporality - Whether to report DELTA or CUMULATIVE metrics.
        bucketBoundaries - A list of (inclusive) upper bounds for the histogram. Should be in order from lowest to highest.
      • histogram

        public static final Aggregation histogram()
        Aggregates measurements using the best available Histogram.