Package io.micronaut.rabbitmq.metrics
Class RabbitMetricsInterceptor
java.lang.Object
io.micronaut.rabbitmq.metrics.RabbitMetricsInterceptor
- All Implemented Interfaces:
io.micronaut.context.event.BeanCreatedEventListener<com.rabbitmq.client.ConnectionFactory>
,EventListener
@Singleton
@RequiresMetrics
@Requires(property="micronaut.metrics.binders.rabbitmq.enabled",
notEquals="false")
public class RabbitMetricsInterceptor
extends Object
implements io.micronaut.context.event.BeanCreatedEventListener<com.rabbitmq.client.ConnectionFactory>
Interceptor of the connection factory to set the metrics collector.
- Since:
- 1.1.0
- Author:
- James Kleeh
-
Constructor Summary
ConstructorDescriptionRabbitMetricsInterceptor
(io.micronaut.context.BeanProvider<io.micrometer.core.instrument.MeterRegistry> meterRegistryBeanProvider, @Nullable String prefix, Map<String, String> tags) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.rabbitmq.client.ConnectionFactory
onCreated
(io.micronaut.context.event.BeanCreatedEvent<com.rabbitmq.client.ConnectionFactory> event)
-
Constructor Details
-
RabbitMetricsInterceptor
public RabbitMetricsInterceptor(io.micronaut.context.BeanProvider<io.micrometer.core.instrument.MeterRegistry> meterRegistryBeanProvider, @Nullable @Property(name="micronaut.metrics.binders.rabbitmq.prefix") @Nullable String prefix, @Property(name="micronaut.metrics.binders.rabbitmq.tags") @MapFormat(transformation=FLAT) Map<String, String> tags) Default constructor.- Parameters:
meterRegistryBeanProvider
- The meter registry bean providerprefix
- The prefixtags
- The tags
-
-
Method Details
-
onCreated
public com.rabbitmq.client.ConnectionFactory onCreated(io.micronaut.context.event.BeanCreatedEvent<com.rabbitmq.client.ConnectionFactory> event) - Specified by:
onCreated
in interfaceio.micronaut.context.event.BeanCreatedEventListener<com.rabbitmq.client.ConnectionFactory>
-