Package io.opentelemetry.sdk.internal
Class AttributeUtil
- java.lang.Object
-
- io.opentelemetry.sdk.internal.AttributeUtil
-
public final class AttributeUtil extends java.lang.ObjectThis class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateAttributeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static <T> booleanallMatch(java.lang.Iterable<T> iterable, java.util.function.Predicate<T> predicate)static java.lang.ObjectapplyAttributeLengthLimit(java.lang.Object value, int lengthLimit)Apply thelengthLimitto the attributevalue.static AttributesapplyAttributesLimit(Attributes attributes, int countLimit, int lengthLimit)Apply thecountLimitandlengthLimitto the attributes.private static booleanisValidLength(java.lang.Object value, int lengthLimit)
-
-
-
Method Detail
-
applyAttributesLimit
public static Attributes applyAttributesLimit(Attributes attributes, int countLimit, int lengthLimit)
Apply thecountLimitandlengthLimitto the attributes.If all attributes fall within the limits, return as is. Else, return an attributes instance with the limits applied.
countLimitlimits the number of unique attribute keys.lengthLimitlimits the length of attribute string and string list values.
-
isValidLength
private static boolean isValidLength(java.lang.Object value, int lengthLimit)
-
allMatch
private static <T> boolean allMatch(java.lang.Iterable<T> iterable, java.util.function.Predicate<T> predicate)
-
applyAttributeLengthLimit
public static java.lang.Object applyAttributeLengthLimit(java.lang.Object value, int lengthLimit)Apply thelengthLimitto the attributevalue. Strings and strings in lists which exceed the length limit are truncated.
-
-