I'm trying to set up APM agent for a Java application. The application is using an Undertow server with HTTP handlers (that means, without the Servlet part of Undertow), which is not supported out of the box. I use the public API to set up transactions around those HTTP handlers and it works.
But the the application is also using Hibernate and a Postgresql JDBC Driver. Injection management is made by Google Guice if it matters. That JDBC driver is recognized out of the box when I set up the agent for a Spring Boot applications... Is there a way I could get the same benefit here, I mean instrumenting JDBC calls without having to try set up spans myself around my Hibernate queries? Is there something to implement to "manually" start the JDBC instrumentation?
I don't think the dependency injection should be an issue- as long as your driver methods are eventually invoked, they should be instrumented and captured.
What may be the issue is that there is no active transaction when the drivers get invoked. This can happen if you do not properly activate() your transactions, or if you do activate them, but the queries are executed asynchronously and your system uses non-supported async execution framework.
If this doesn't provide enough hint for the solution, please set your agent's log_level to debug and restart your application. The log would contain all instrumentations that were matched against loaded classes as well as other useful info, maybe this will assist.
Thank you very much. The problem was the activate(). I think that the fact we were able to get our own transactions and spans without that call was hiding that miss.
Awesome, I am happy to hear you got this resolved!
Please make sure to properly close all returned Scopes, preferably using try-with-resource, as explained in the docs.
Yep, I checked that too. Now we can see all auto-instrumentations and that's pretty cool. Thank you very much for your quick support, it helped a lot today.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.