Class MetricsConfigurationEnhancer
java.lang.Object
org.axonframework.extension.metrics.micrometer.MetricsConfigurationEnhancer
- All Implemented Interfaces:
ConfigurationEnhancer
Implementation of the
ConfigurationEnhancer that uses the MeterRegistry to decorate several
components with MessageMonitors with unique MetricRegistries by registering
MessageMonitorFactories with the
MessageMonitorRegistry.
Components that are decorated are:
- Any
CommandBusimplementation present in theComponentRegistryreceives a}, andinvalid @link
{@link MessageCountingMonitor), {@link MessageTimerMonitorCapacityMonitor. - Any
EventSinkimplementation present in theComponentRegistryreceives a invalid input: '{@code MessageCountingMonitor) and {@code MessageTimerMonitor}.</li> <li>Any {@link EventProcessor} implementation present in the {@link ComponentRegistry} receives a {@code MessageCountingMonitor), {@code MessageTimerMonitor}, {@code CapacityMonitor}, and {@link EventProcessorLatencyMonitor}.</li> <li>Any {@link QueryBus} implementation present in the {@link ComponentRegistry} receives a {@code MessageCountingMonitor), {@code MessageTimerMonitor}, and {@code CapacityMonitor}.</li> </ul> <p> When constructing the {@code MetricsConfigurationEnhancer}, users can choose to add dimensionality to the measurements. When enabled, Micrometer {@link Tag tags} are added by default for the {@link Message#type() message type} {@link MessageType#name() name} and {@link EventProcessor} names, when applicable. @author Steven van Beelen @author Marijn van Zelst @author Ivan Dugalic @since 4.1.0'
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe order ofthisenhancer, set to-1024. -
Constructor Summary
ConstructorsConstructorDescriptionInitializes a newMetricsConfigurerModuleconstructingMessageMonitorsthat are registered with a newMeterRegistrywith default settings.MetricsConfigurationEnhancer(io.micrometer.core.instrument.MeterRegistry registry) Initializes a newMetricsConfigurerModuleconstructingMessageMonitorsthat are registered with the givenregistry.MetricsConfigurationEnhancer(io.micrometer.core.instrument.MeterRegistry registry, boolean useDimensions) Initializes a newMetricsConfigurerModuleconstructingMessageMonitorsthat are registered with the givenregistryanduseDimensionstoggle. -
Method Summary
Modifier and TypeMethodDescriptionvoidenhance(ComponentRegistry registry) intorder()Returns the relative order this enhancer should be invoked in, compared to other instances.
-
Field Details
-
ENHANCER_ORDER
public static final int ENHANCER_ORDERThe order ofthisenhancer, set to-1024.- See Also:
-
-
Constructor Details
-
MetricsConfigurationEnhancer
public MetricsConfigurationEnhancer()Initializes a newMetricsConfigurerModuleconstructingMessageMonitorsthat are registered with a newMeterRegistrywith default settings.Will have dimensionality enabled, which will add
tagsto measurements. -
MetricsConfigurationEnhancer
public MetricsConfigurationEnhancer(io.micrometer.core.instrument.MeterRegistry registry) Initializes a newMetricsConfigurerModuleconstructingMessageMonitorsthat are registered with the givenregistry.Will have dimensionality enabled, which will add
tagsto measurements.- Parameters:
registry- theMeterRegistrywhich will record the metrics
-
MetricsConfigurationEnhancer
public MetricsConfigurationEnhancer(io.micrometer.core.instrument.MeterRegistry registry, boolean useDimensions) Initializes a newMetricsConfigurerModuleconstructingMessageMonitorsthat are registered with the givenregistryanduseDimensionstoggle.- Parameters:
registry- theMeterRegistrywhich will record the metricsuseDimensions- when set totruewill addtagsto measurements
-
-
Method Details
-
enhance
Description copied from interface:ConfigurationEnhancer- Specified by:
enhancein interfaceConfigurationEnhancer- Parameters:
registry- The registry instance to enhance.
-
order
public int order()Description copied from interface:ConfigurationEnhancerReturns the relative order this enhancer should be invoked in, compared to other instances.Use lower (negative) values for enhancers providing sensible defaults, and higher values for enhancers that should be able to override values potentially previously set. Defaults to
0when not set.- Specified by:
orderin interfaceConfigurationEnhancer- Returns:
- The order in which this enhancer should be invoked.
-