Configure ObservationRegistry on JmsListener
Prior to this commit, we set in gh-37388 the ObservationRegistry on the auto-configured JmsTemplate bean. This enables observations and context propagation when sending JMS messages. This commit applies the same to the `DefaultJmsListenerContainerFactory` and the `DefaultJmsListenerContainerFactoryConfigurer`, in order to enable observations on `@JmsListener` annotated methods. This commit also refactors the support implemented in gh-37388 to avoid relying on a bean post processor and instead set the observation registry directly in the main auto-configuration: while Micrometer core is an actuator-only dependency, Micrometer Observation API is a compile dependnecy for spring-jms itself and there is no need to separate concerns there. Fixes gh-38613
This commit is contained in:
@@ -745,10 +745,9 @@ Metrics are tagged by the name of the executor, which is derived from the bean n
|
||||
|
||||
[[actuator.metrics.supported.jms]]
|
||||
==== JMS Metrics
|
||||
Auto-configuration enables the instrumentation of all available `JmsTemplate` beans.
|
||||
`JmsMessagingTemplate` instances built with instrumented `JmsTemplate` beans will also record observations.
|
||||
See the {spring-framework-docs}/integration/observability.html#observability.jms.publish[Spring Framework reference documentation for more information on produced observations].
|
||||
|
||||
Auto-configuration enables the instrumentation of all available `JmsTemplate` beans and `@JmsListener` annotated methods.
|
||||
This will produce `"jms.message.publish"` and `"jms.message.process"` metrics respectively.
|
||||
See the {spring-framework-docs}/integration/observability.html#observability.jms[Spring Framework reference documentation for more information on produced observations].
|
||||
|
||||
|
||||
[[actuator.metrics.supported.spring-mvc]]
|
||||
|
||||
Reference in New Issue
Block a user