Package io.opentelemetry.sdk.metrics
Class ViewBuilder
java.lang.Object
io.opentelemetry.sdk.metrics.ViewBuilder
A builder for
View.- Since:
- 1.14.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns aViewwith the configuration of this builder.setAggregation(Aggregation aggregation) SetsAggregation.setAttributeFilter(Predicate<String> keyFilter) Sets a filter for attributes keys.setAttributeFilter(Set<String> keysToRetain) Sets a filter which retains attribute keys included inkeysToRetain.setCardinalityLimit(int cardinalityLimit) Set the cardinality limit.setDescription(String description) Sets the description of the resulting metric.Sets the name of the resulting metric.
-
Method Details
-
setName
Sets the name of the resulting metric.- Parameters:
name- metric name ornullif the matched instrument name should be used.
-
setDescription
Sets the description of the resulting metric.- Parameters:
description- metric description ornullif the matched instrument description should be used.
-
setAggregation
SetsAggregation.- Parameters:
aggregation- aggregation to use.
-
setAttributeFilter
Sets a filter which retains attribute keys included inkeysToRetain.- Since:
- 1.30.0
-
setAttributeFilter
Sets a filter for attributes keys.Only attribute keys that pass the supplied
Predicatewill be included in the output.- Parameters:
keyFilter- filter for attribute keys to include.
-
setCardinalityLimit
Set the cardinality limit.Read
MemoryModeto understand the memory usage behavior of reaching cardinality limit.- Parameters:
cardinalityLimit- the maximum number of series for a metric- Since:
- 1.44.0
-
build
Returns aViewwith the configuration of this builder.
-