Class ViewBuilder

java.lang.Object
io.opentelemetry.sdk.metrics.ViewBuilder

public final class ViewBuilder extends Object
A builder for View.
Since:
1.14.0
  • Method Details

    • setName

      public ViewBuilder setName(String name)
      Sets the name of the resulting metric.
      Parameters:
      name - metric name or null if the matched instrument name should be used.
    • setDescription

      public ViewBuilder setDescription(String description)
      Sets the description of the resulting metric.
      Parameters:
      description - metric description or null if the matched instrument description should be used.
    • setAggregation

      public ViewBuilder setAggregation(Aggregation aggregation)
      Parameters:
      aggregation - aggregation to use.
    • setAttributeFilter

      public ViewBuilder setAttributeFilter(Predicate<String> keyFilter)
      Sets a filter for attributes keys.

      Only attribute keys that pass the supplied Predicate will be included in the output.

      Parameters:
      keyFilter - filter for attribute keys to include.
    • build

      public View build()
      Returns a View with the configuration of this builder.