-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Add observability support for JMS #30335
Comments
This was working with Sleuth, and after switching to micrometer tracing this is no longer working. |
@simasch I am not sure I understand your question. You are commenting on the very issue doing that, scheduled for 6.1.x... |
@snicoll Oh I'm sorry. I didn't notice the milestone! Probably I shouldn't work on weekends 😅 |
Sorry for bothering but I have to ask. Is there any chance that it will be in Spring 6.1? I am asking because most of the missing pieces of observability were resolved and this is still untouched. Is there any blocker in JMS that blocks it? |
@Saljack no worries. I'm currently working on it and this is targeted for the next milestone. Most of the instrumentation is not Spring specific so I'm preparing a PR for Micrometer to generally instrument Jakarta JMS Session instances. I'll report back here as soon as I've got news. |
Here is the PR for the Jakarta JMS instrumentation in Micrometer core: micrometer-metrics/micrometer#4007 |
This commit adds observability support for Jakarta JMS support in spring-jms support. This feature leverages the `JmsInstrumentation` infrastructure in `io.micrometer:micrometer-core` library. This instruments the `JmsTemplate` and the `@JmsListener` support to record observations: * "jms.message.publish" when the `JmsTemplate` sends a message * "jms.message.process" when a message is processed by a `@JmsListener` annotated method The observation `Convention` and `Context` implementations are shipped with "micrometer-core". Closes spring-projectsgh-30335
This broke Spring Boot's build.
See this build scan |
@bclozel Should his beta feature include Span/TraceId propagation code? I did a small test with latest milestone and producer did not put any tracing header auomatically nor receiver decode it, at least via JmsTemplate calls. I don't see any mention to trace/span in neither your MR nor micrometer one (metrics-side but not tracing), so Ill ask just in case if this remains unsupported |
Is your current setup producing metrics with the |
I face the same problem. Have prepared two minimal examples - one with old sleuth setup, new with micrometer. I have no tracing even with SP 3.1.4 (which has all micrometer updates etc). |
@mbadziong You have to use Spring Boot 3.2 RC. |
@Saljack You mean v3.2.0-M2, right? Anyway! My issue is fixed. My bad, I presumed the autoconfiguration worked in a postprocessor/customizer fashion, but once I explictly set the ObservationRegistry on my locally exposed JmsTemplates or JmsListenerContainerFactorys everything is supersmooth. I'll check in an E2E across services, if I see something I will open a bug. Thanks @bclozel ! |
@bclozel Just a very nitpicking suggestion, but adding the ObservationRegistry setter to JmsDefaultListenerContainerSpec would be nice! |
@nightswimmings the As for the lack of auto-configuration in Spring Boot, that's a good point. Spring Boot currently auto-configures a |
FYI. Micrometer Jms Implementation seems to be faulty, it is not escaping the Property Names according to defined standard. |
@mbadziong is there any working sample project what you've talked about jms with micrometer configuration? I'm new to JMS and micrometer with spring boot 3. It will be helpful if you give a working sample project. |
can you provide an example of what you did? |
@WrRaThY <!-- Observability / Tracing is implemented in Actuator. Check that you really use it -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Tracing library. It enrich clients (JmsTemplate) and processes incoming requests (JmsListener). You can replace it with OTEL -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<!-- It is for reporting to Zipkin, you can omit it if you do not want to report tracing or replace it with a different reporter -->
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
</dependency> Then you need to check if your jmsTemplate.setObservationRegistry(observationRegistry); The same thing you have to do for I had to also disable consuming B3 headers because if a message does not contain any tracing header then it (also with disabling B3 Multi) throws an management.tracing.propagation.consume=W3C So I would start with debugging if your JmsTemplate has configured any I hope I did not forget anything important. I would also check your JMS library because for example we use Azure ServiceBus JMS which uses QPid and there is their autoconfiguration in the Azure library which overrides the original from Spring Boot. |
Thank you for such a wholesome answer @Saljack When it comes to this particular issue: I modified the minimal example project that was shared here and with boot 3.2.1 everything works out of the box. Communication between 2.7.18 and 3.2.1 works as well. No bugs to report, case closed. I'll leave some notes for others who may stumble upon this issue in the future. My project's goal is to move deps from java8/boot 2.0.2 to java 17/boot 3.2.1. This is important because it seems that So for anyone reading this - if the goal is to upgrade whatever 2.x version of spring to 3.x - first upgrade to 2.7.18 and stop wasting the time of the maintainers XD |
See #30094 for some background.
I'm primarily interested in the following:
JmsOperations
)JmsOperations
directly or@JmsListener
)The goal is to have spans from both the producer and the consumer side as a part of the same trace.
I think that something like this is possible when using Spring Integration (see the relevant docs), but it would be nice if core Spring JMS support also had support for observability.
The text was updated successfully, but these errors were encountered: