Auto-configure ObservationRegistry on JmsTemplate

Spring Boot auto-configures both a `JmsTemplate` and a
`JmsMessagingTemplate`. As of Spring Framework 6.2, JMS has
observability support when publishing messages.

This commit creates a bean post-processor that configures an
`ObservationRegistry` on the template, if the registry is present.

Closes gh-37388
This commit is contained in:
Brian Clozel
2023-09-15 16:28:06 +02:00
parent d6daf87074
commit 0fc97e9315
5 changed files with 170 additions and 0 deletions

View File

@@ -739,6 +739,13 @@ Auto-configuration enables the instrumentation of all available `ThreadPoolTaskE
Metrics are tagged by the name of the executor, which is derived from the bean name.
[[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].
[[actuator.metrics.supported.spring-mvc]]
==== Spring MVC Metrics