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.
A functional interface that selects default
Aggregation
based on InstrumentType
.- Since:
- 1.16.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
asString
(DefaultAggregationSelector selector) Returns a string representation of this selector, for using inObject.toString()
implementations.static DefaultAggregationSelector
The default implementation ofDefaultAggregationSelector
which returns the default aggregation for each instrument.getDefaultAggregation
(InstrumentType instrumentType) Return the default aggregation for theInstrumentType
.default DefaultAggregationSelector
with
(InstrumentType instrumentType, Aggregation aggregation) Returns a default aggregation selector which returns the givenaggregation
for the giveninstrumentType
, and defers to this for other instrument types.
-
Method Details
-
getDefault
The default implementation ofDefaultAggregationSelector
which returns the default aggregation for each instrument. -
with
Returns a default aggregation selector which returns the givenaggregation
for 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
Return the default aggregation for theInstrumentType
.The default aggregation is used when an instrument does not match any views.
-
asString
Returns a string representation of this selector, for using inObject.toString()
implementations.- Since:
- 1.38.0
-