Class Aggregation

java.lang.Object
io.opentelemetry.sdk.metrics.view.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 Details

    • createAggregator

      public abstract <T> io.opentelemetry.sdk.metrics.internal.aggregator.Aggregator<T> createAggregator(io.opentelemetry.sdk.metrics.internal.descriptor.InstrumentDescriptor instrumentDescriptor, ExemplarFilter exemplarFilter)
      Returns a new Aggregator.
      Parameters:
      instrumentDescriptor - the descriptor of the Instrument that will record measurements.
      exemplarFilter - the filter on which measurements should turn into exemplars
      Returns:
      a new Aggregator. Aggregator.drop() indicates no measurements should be recorded.
    • drop

      public static Aggregation drop()
      The drop 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.
    • explicitBucketHistogram

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

      public static Aggregation explicitBucketHistogram(List<Double> bucketBoundaries)
      Aggregates measurements into an explicit bucket histogram.
      Parameters:
      bucketBoundaries - A list of (inclusive) upper bounds for the histogram. Should be in order from lowest to highest.
    • histogram

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