Class ConfigAdapter


  • public class ConfigAdapter
    extends Object
    • Method Detail

      • captureProperties

        public static Map<String,​String> captureProperties​(org.eclipse.microprofile.config.Config config,
                                                                 String prefix)
        Accept the Quarkus config object and a prefix, e.g. quarkus.micrometer.export.prometheus.. This will:
        • Lift all properties from the global config map whose keys start with the prefix
        • Trim quarkus.micrometer.export. from the beginning of the relevant key
        • Replace kebab-case with camelCase in the relevant key
        • Insert the transformed key and the original value into a new map
        Parameters:
        config - Quarkus Config
        prefix - A String prefix beginning with quarkus. and ending with ..
        Returns:
        A map containing transformed keys and associated values
      • captureProperties

        public static Map<String,​String> captureProperties​(Map<String,​String> config,
                                                                 String prefix)
        Accept a map and a prefix, e.g. prometheus.. This will:
        • Replace kebab-case with camelCase in each key
        • Add the prefix to each key
        • Insert the transformed key and the original value into a new map
        Parameters:
        config - A Runtime config map of string keys and properties, e.g. PrometheusRuntimeConfig.prometheus
        prefix - A String prefix ending with ., e.g. prometheus.
        Returns:
        A map containing transformed keys and associated values
      • validate

        public static <T extends io.micrometer.core.instrument.config.MeterRegistryConfig> T validate​(T config)
      • validate

        public static <T extends io.micrometer.core.instrument.config.MeterRegistryConfig> T validate​(T config,
                                                                                                      io.micrometer.core.instrument.config.validate.Validated validated)