Class AttributeUtil

java.lang.Object
io.opentelemetry.sdk.internal.AttributeUtil

public final class AttributeUtil extends Object
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
  • Constructor Details

    • AttributeUtil

      private AttributeUtil()
  • Method Details

    • applyAttributesLimit

      public static Attributes applyAttributesLimit(Attributes attributes, int countLimit, int lengthLimit)
      Apply the countLimit and lengthLimit to the attributes.

      If all attributes fall within the limits, return as is. Else, return an attributes instance with the limits applied. countLimit limits the number of unique attribute keys. lengthLimit limits the length of attribute string and string list values.

    • isValidLength

      private static boolean isValidLength(Object value, int lengthLimit)
    • allMatch

      private static <T> boolean allMatch(Iterable<T> iterable, Predicate<T> predicate)
    • applyAttributeLengthLimit

      public static Object applyAttributeLengthLimit(Object value, int lengthLimit)
      Apply the lengthLimit to the attribute value. Strings and strings in lists which exceed the length limit are truncated.