public class GlobalMetricRegistry extends Object
| Constructor and Description | 
|---|
GlobalMetricRegistry()
Initializes a new  
GlobalMetricRegistry delegating to a new MeterRegistry with default settings. | 
GlobalMetricRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
Initializes a  
GlobalMetricRegistry delegating to the given meterRegistry. | 
| Modifier and Type | Method and Description | 
|---|---|
io.micrometer.core.instrument.MeterRegistry | 
getRegistry()
Returns the global  
MeterRegistry to which components are registered. | 
MessageMonitor<? super CommandMessage<?>> | 
registerCommandBus(String commandBusName)
Registers new metrics to the registry to monitor a  
CommandBus. | 
MessageMonitor<? super CommandMessage<?>> | 
registerCommandBus(String commandBusName,
                  Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
Registers new metrics to the registry to monitor a  
CommandBus using Tags through the given tagsBuilder. | 
MessageMonitor<? extends Message<?>> | 
registerComponent(Class<?> componentType,
                 String componentName)
Registers new metrics to the registry to monitor a component of the given  
componentType. | 
MessageMonitor<? extends Message<?>> | 
registerComponentWithDefaultTags(Class<?> componentType,
                                String componentName)
Registers new metrics to the registry to monitor a component of the given  
componentType. | 
MessageMonitor<? super EventMessage<?>> | 
registerEventBus(String eventBusName)
Registers new metrics to the registry to monitor an  
EventBus. | 
MessageMonitor<? super EventMessage<?>> | 
registerEventBus(String eventBusName,
                Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
Registers new metrics to the registry to monitor an  
EventBus using Tags through the given tagsBuilder. | 
MessageMonitor<? super EventMessage<?>> | 
registerEventProcessor(String eventProcessorName)
Registers new metrics to the registry to monitor an  
EventProcessor. | 
MessageMonitor<? super EventMessage<?>> | 
registerEventProcessor(String eventProcessorName,
                      Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
Deprecated. 
 
Please use the  
registerEventProcessor(String, Function, Function) instead, which has
 separate tags for the latency metric. | 
MessageMonitor<? super EventMessage<?>> | 
registerEventProcessor(String eventProcessorName,
                      Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder,
                      Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> latencyTagsBuilder)
Registers new metrics to the registry to monitor an  
EventProcessor using Tags through the given
 tagsBuilder. | 
MessageMonitor<? super QueryMessage<?,?>> | 
registerQueryBus(String queryBusName)
Registers new metrics to the registry to monitor a  
QueryBus. | 
MessageMonitor<? super QueryMessage<?,?>> | 
registerQueryBus(String queryBusName,
                Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
Registers new metrics to the registry to monitor a  
QueryBus using Tags through the given tagsBuilder. | 
Configurer | 
registerWithConfigurer(Configurer configurer)
Registers the  
MeterRegistry with the given configurer via Configurer.configureMessageMonitor(Function). | 
Configurer | 
registerWithConfigurerWithDefaultTags(Configurer configurer)
Registers the  
MeterRegistry with the given configurer via Configurer.configureMessageMonitor(Function). | 
public GlobalMetricRegistry()
GlobalMetricRegistry delegating to a new MeterRegistry with default settings.public GlobalMetricRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
GlobalMetricRegistry delegating to the given meterRegistry.meterRegistry - the MeterRegistry which will record the metricspublic Configurer registerWithConfigurer(Configurer configurer)
MeterRegistry with the given configurer via Configurer.configureMessageMonitor(Function). Components registered by the Configurer will be added by
 invocation of registerComponent(Class, String).configurer - the application's ConfigurerConfigurer, with the new registration applied, for chainingpublic Configurer registerWithConfigurerWithDefaultTags(Configurer configurer)
MeterRegistry with the given configurer via Configurer.configureMessageMonitor(Function). Components registered by the Configurer will be added by
 invocation of registerComponentWithDefaultTags(Class, String).configurer - the application's ConfigurerConfigurer, with the new registration applied using Tags, for chainingpublic MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName)
componentType. The monitor will
 be registered with the MeterRegistry under the given componentName. The returned MessageMonitor can be installed on the component to initiate the monitoring.componentType - the type of component to registercomponentName - the name under which the component should be registered to the registryMessageMonitor to monitor the behavior of a given componentTypepublic MessageMonitor<? super EventMessage<?>> registerEventProcessor(String eventProcessorName)
EventProcessor. The monitor will be registered with
 the registry under the given eventProcessorName. The returned MessageMonitor can be installed on
 the EventProcessor to initiate the monitoring.eventProcessorName - the name under which the EventProcessor should be registered to the registryMessageMonitor to monitor the behavior of an EventProcessorpublic MessageMonitor<? super CommandMessage<?>> registerCommandBus(String commandBusName)
CommandBus. The monitor will be registered with the
 registry under the given commandBusName. The returned MessageMonitor can be installed on the
 CommandBus to initiate the monitoring.commandBusName - the name under which the CommandBus should be registered to the registryMessageMonitor to monitor the behavior of a CommandBuspublic MessageMonitor<? super EventMessage<?>> registerEventBus(String eventBusName)
EventBus. The monitor will be registered with the
 registry under the given eventBusName. The returned MessageMonitor can be installed on the EventBus to initiate the monitoring.eventBusName - the name under which the EventBus should be registered to the registryMessageMonitor to monitor the behavior of an EventBuspublic MessageMonitor<? super QueryMessage<?,?>> registerQueryBus(String queryBusName)
QueryBus. The monitor will be registered with the
 registry under the given queryBusName. The returned MessageMonitor can be installed on the QueryBus to initiate the monitoring.queryBusName - the name under which the QueryBus should be registered to the registryMessageMonitor to monitor the behavior of a QueryBuspublic MessageMonitor<? extends Message<?>> registerComponentWithDefaultTags(Class<?> componentType, String componentName)
componentType. The monitor will
 be registered with the registry under the given componentName, utilizing Tags. The default set of
 Tags includes the 'message payload type' and additionally the 'processor name' for the EventProcessor instances. The returned MessageMonitor can be installed on the component to initiate the
 monitoring.componentType - the type of component to registercomponentName - the name under which the component should be registered to the registryMessageMonitor with Tags enabled to monitor the behavior of the given componentType@Deprecated public MessageMonitor<? super EventMessage<?>> registerEventProcessor(String eventProcessorName, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
registerEventProcessor(String, Function, Function) instead, which has
 separate tags for the latency metric.EventProcessor using Tags through the given
 tagsBuilder. The monitor will be registered with the registry under the given eventProcessorName.
 The returned MessageMonitor can be installed on the EventProcessor to initiate the monitoring.eventProcessorName - the name under which the EventProcessor should be registered to the registrytagsBuilder - the function used to construct the list of Tag, based on the ingested messageMessageMonitor to monitor the behavior of an EventProcessorpublic MessageMonitor<? super EventMessage<?>> registerEventProcessor(String eventProcessorName, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> latencyTagsBuilder)
EventProcessor using Tags through the given
 tagsBuilder. The monitor will be registered with the registry under the given eventProcessorName.
 The returned MessageMonitor can be installed on the EventProcessor to initiate the monitoring.
 
 The second tags builder parameter is specifically for the latency metric. These tags might be wanted to be less
 specific than the others. For example, the MessageTimerMonitor makes sense per payload type, but the
 latency makes sense only for the event processor as a whole.
eventProcessorName - the name under which the EventProcessor should be registered to the registrytagsBuilder - the function used to construct the list of Tag, based on the ingested messageMessageMonitor to monitor the behavior of an EventProcessorpublic MessageMonitor<? super CommandMessage<?>> registerCommandBus(String commandBusName, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
CommandBus using Tags through the given tagsBuilder. The monitor will be registered with the registry under the given commandBusName. The
 returned MessageMonitor can be installed on the CommandBus to initiate the monitoring.commandBusName - the name under which the CommandBus should be registered to the registrytagsBuilder - the function used to construct the list of Tag, based on the ingested messageMessageMonitor to monitor the behavior of a CommandBuspublic MessageMonitor<? super EventMessage<?>> registerEventBus(String eventBusName, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
EventBus using Tags through the given tagsBuilder. The monitor will be registered with the registry under the given eventBusName. The returned
 MessageMonitor can be installed on the EventBus to initiate the monitoring.eventBusName - the name under which the EventBus should be registered to the registrytagsBuilder - the function used to construct the list of Tag, based on the ingested messageMessageMonitor to monitor the behavior of an EventBuspublic MessageMonitor<? super QueryMessage<?,?>> registerQueryBus(String queryBusName, Function<Message<?>,Iterable<io.micrometer.core.instrument.Tag>> tagsBuilder)
QueryBus using Tags through the given tagsBuilder. The monitor will be registered with the registry under the given queryBusName. The returned
 MessageMonitor can be installed on the QueryBus to initiate the monitoring.queryBusName - the name under which the QueryBus should be registered to the registrytagsBuilder - the function used to construct the list of Tag, based on the ingested messageMessageMonitor to monitor the behavior of a QueryBuspublic io.micrometer.core.instrument.MeterRegistry getRegistry()
MeterRegistry to which components are registered.Copyright © 2010–2025. All rights reserved.