Class SdkMeterProviderUtil


  • public final class SdkMeterProviderUtil
    extends java.lang.Object
    A collection of methods that allow use of experimental features prior to availability in public APIs.

    This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

    • Constructor Detail

      • SdkMeterProviderUtil

        private SdkMeterProviderUtil()
    • Method Detail

      • appendFilteredBaggageAttributes

        public static void appendFilteredBaggageAttributes​(ViewBuilder viewBuilder,
                                                           java.util.function.Predicate<java.lang.String> keyFilter)
        Reflectively add an AttributesProcessor to the ViewBuilder which appends key-values from baggage to all measurements.

        Note: This runs after all other attribute processing added so far.

        Parameters:
        viewBuilder - the builder
        keyFilter - Only baggage key values pairs where the key matches this predicate will be appended.
      • appendAllBaggageAttributes

        public static void appendAllBaggageAttributes​(ViewBuilder viewBuilder)
        Reflectively add an AttributesProcessor to the ViewBuilder which appends all key-values from baggage to all measurements.

        Note: This runs after all other attribute processing added so far.

        Parameters:
        viewBuilder - the builder
      • setCardinalityLimit

        public static void setCardinalityLimit​(ViewBuilder viewBuilder,
                                               int cardinalityLimit)
        Reflectively set the cardinalityLimit on the ViewBuilder.
        Parameters:
        viewBuilder - the builder
      • resetForTest

        public static void resetForTest​(SdkMeterProvider sdkMeterProvider)
        Reflectively reset the SdkMeterProvider, clearing all registered instruments.