Interface DefaultAggregationSelector
-
- All Known Subinterfaces:
MetricExporter,MetricReader
- All Known Implementing Classes:
OtlpGrpcMetricExporter,OtlpHttpMetricExporter,PeriodicMetricReader
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface DefaultAggregationSelectorA functional interface that selects defaultAggregationbased onInstrumentType.- Since:
- 1.16.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static java.lang.StringasString(DefaultAggregationSelector selector)Returns a string representation of this selector, for using inObject.toString()implementations.static DefaultAggregationSelectorgetDefault()The default implementation ofDefaultAggregationSelectorwhich returns the default aggregation for each instrument.AggregationgetDefaultAggregation(InstrumentType instrumentType)Return the default aggregation for theInstrumentType.default DefaultAggregationSelectorwith(InstrumentType instrumentType, Aggregation aggregation)Returns a default aggregation selector which returns the givenaggregationfor the giveninstrumentType, and defers to this for other instrument types.
-
-
-
Method Detail
-
getDefault
static DefaultAggregationSelector getDefault()
The default implementation ofDefaultAggregationSelectorwhich returns the default aggregation for each instrument.
-
with
default DefaultAggregationSelector with(InstrumentType instrumentType, Aggregation aggregation)
Returns a default aggregation selector which returns the givenaggregationfor the giveninstrumentType, and defers to this for other instrument types.For example, the following produces a selector which drops histograms and uses the default aggregation for other instruments:
// DefaultAggregationSelector selector = // DefaultAggregationSelector.getDefault() // .with(InstrumentType.HISTOGRAM, Aggregation.drop());- Since:
- 1.16.0
-
getDefaultAggregation
Aggregation getDefaultAggregation(InstrumentType instrumentType)
Return the default aggregation for theInstrumentType.The default aggregation is used when an instrument does not match any views.
-
asString
static java.lang.String asString(DefaultAggregationSelector selector)
Returns a string representation of this selector, for using inObject.toString()implementations.- Since:
- 1.38.0
-
-