Class MetricRegistries


  • @ApplicationScoped
    public class MetricRegistries
    extends Object
    Author:
    hrupp
    • Field Detail

      • SERVER_LEVEL_MPCONFIG_GLOBAL_TAGS

        protected static io.micrometer.core.instrument.Tag[] SERVER_LEVEL_MPCONFIG_GLOBAL_TAGS
        This static Tag[] represents the server level global tags retrieved from MP Config for mp.metrics.tags. This value will be 'null' when not initialized. If during initialization and no global tag has been resolved this will be to an array of size 0. Using an array of size 0 is to represent that an attempt on start up was made to resolve the value, but none was found. This prevents later instantiations of MetricRegistry to avoid attempting to resolve the MP Config value for the slight performance boon. This server level value will not change at all throughout the life time of the server as it is defined by env vars or sys props.
      • MP_APP_METER_REG_ACCESS

        public static final ThreadLocal<Boolean> MP_APP_METER_REG_ACCESS
      • MP_BASE_METER_REG_ACCESS

        public static final ThreadLocal<Boolean> MP_BASE_METER_REG_ACCESS
      • MP_VENDOR_METER_REG_ACCESS

        public static final ThreadLocal<Boolean> MP_VENDOR_METER_REG_ACCESS
    • Constructor Detail

      • MetricRegistries

        public MetricRegistries()
    • Method Detail

      • getApplicationRegistry

        @Produces
        @Default
        @RegistryType(type=APPLICATION)
        @ApplicationScoped
        public org.eclipse.microprofile.metrics.MetricRegistry getApplicationRegistry()
      • getBaseRegistry

        @Produces
        @RegistryType(type=BASE)
        @ApplicationScoped
        public org.eclipse.microprofile.metrics.MetricRegistry getBaseRegistry()
      • getVendorRegistry

        @Produces
        @RegistryType(type=VENDOR)
        @ApplicationScoped
        public org.eclipse.microprofile.metrics.MetricRegistry getVendorRegistry()
      • getOrCreate

        public static org.eclipse.microprofile.metrics.MetricRegistry getOrCreate​(org.eclipse.microprofile.metrics.MetricRegistry.Type type)
      • getOrCreate

        public static org.eclipse.microprofile.metrics.MetricRegistry getOrCreate​(org.eclipse.microprofile.metrics.MetricRegistry.Type type,
                                                                                  ApplicationNameResolver appNameResolver)
      • drop

        public static void drop​(org.eclipse.microprofile.metrics.MetricRegistry.Type type)
        Drops a particular registry. If a reference to the same registry type is requested later, a new empty registry will be created for that purpose.
        Parameters:
        type - Type of registry that should be dropped.
      • dropAll

        public static void dropAll()
        Drops all registries. If a reference to a registry is requested later, a new empty registry will be created for that purpose.