Micrometer Observation

从版本 3.0 开始,现在可以为 RabbitTemplate 和侦听器容器使用 Micrometer 进行观察。

Using Micrometer for observation is now supported, since version 3.0, for the RabbitTemplate and listener containers.

在每个组件上设置`observationEnabled`以启用观察; 这会禁用Micrometer Timers,因为现在将使用每个观察管理计时器。 当使用带注释的侦听器时,在容器工厂上设置`observationEnabled`。

Set observationEnabled on each component to enable observation; this will disable Micrometer Timers because the timers will now be managed with each observation. When using annotated listeners, set observationEnabled on the container factory.

有关更多信息,请参阅 Micrometer Tracing

Refer to Micrometer Tracing for more information.

若要向计时器/跟踪添加标记,请分别将自定义 RabbitTemplateObservationConventionRabbitListenerObservationConvention 配置为模板或侦听器容器。

To add tags to timers/traces, configure a custom RabbitTemplateObservationConvention or RabbitListenerObservationConvention to the template or listener container, respectively.

默认实现会为模板观察添加 name 标记,为容器添加 listener.id 标记。

The default implementations add the name tag for template observations and listener.id tag for containers.

您可以子类化 DefaultRabbitTemplateObservationConventionDefaultRabbitListenerObservationConvention 或提供全新的实现。

You can either subclass DefaultRabbitTemplateObservationConvention or DefaultRabbitListenerObservationConvention or provide completely new implementations.

有关更多详细信息,请参阅 Micrometer Observation Documentation

See Micrometer Observation Documentation for more details.

由于批处理中跟踪的处理方式存在歧义,所以 observations 为 NOT 创建,供 Batch Listener Containers 使用。

Due to ambiguity in how traces should be handled in a batch, observations are NOT created for Batch Listener Containers.