Class AttributesProcessor

    • Constructor Detail

      • AttributesProcessor

        AttributesProcessor()
    • Method Detail

      • process

        public abstract Attributes process​(Attributes incoming,
                                           Context context)
        Manipulates a set of attributes, returning the desired set.
        Parameters:
        incoming - Attributes associated with an incoming measurement.
        context - The context associated with the measurement.
      • usesContext

        public abstract boolean usesContext()
        If true, this ensures the `Context` argument of the attributes processor is always accurate. This will prevents bound instruments from pre-locking their metric-attributes and defer until context is available.
      • noop

        public static AttributesProcessor noop()
        No-op version of attributes processor, returns what it gets.
      • filterByKeyName

        public static AttributesProcessor filterByKeyName​(java.util.function.Predicate<java.lang.String> nameFilter)
        Creates a processor which filters down attributes from a measurement.
        Parameters:
        nameFilter - a filter for which attribute keys to preserve.
      • appendBaggageByKeyName

        public static AttributesProcessor appendBaggageByKeyName​(java.util.function.Predicate<java.lang.String> nameFilter)
        Creates a processor which appends values from Baggage.

        These attributes will not override those attributes provided by instrumentation.

        Parameters:
        nameFilter - a filter for which baggage keys to select.
      • append

        public static AttributesProcessor append​(Attributes attributes)
        Creates a processor which appends (exactly) the given attributes.

        These attributes will not override those attributes provided by instrumentation.

        Parameters:
        attributes - Attributes to append to measurements.
      • setIncludes

        public static java.util.function.Predicate<java.lang.String> setIncludes​(java.util.Set<java.lang.String> set)
        Creates a Predicate which tests if the set includes the input.