Skip to content

Auto-configure ObservationRegistry on JmsTemplate #37388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bclozel opened this issue Sep 14, 2023 · 0 comments
Closed

Auto-configure ObservationRegistry on JmsTemplate #37388

bclozel opened this issue Sep 14, 2023 · 0 comments
Assignees
Labels
theme: observability Issues related to observability type: enhancement A general enhancement
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Sep 14, 2023

As of spring-projects/spring-framework#30335, JmsTemplate can be configured with an ObservationRegistry in order to record JMS observations at runtime. Given the scope of this, we should probably approach this with a bean post processor and automatically configure the registry on the JmsTemplate bean we are contributing.

@bclozel bclozel added type: enhancement A general enhancement theme: observability Issues related to observability labels Sep 14, 2023
@bclozel bclozel added this to the 3.2.0-M3 milestone Sep 14, 2023
@bclozel bclozel self-assigned this Sep 14, 2023
bclozel added a commit that referenced this issue Dec 1, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: observability Issues related to observability type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant