Your root package setting seems OK, no need for sub-packages.
Note that if you capture a Span while there is no active transaction, this span will not be sent and stored. So you should verify that for each request, the first event is traced through CaptureTransaction and all subsequent events are captured through CaptureSpan. From the code you added, I can't see if this is indeed related to the problem or not.
For more info see our data model documentation.
I hope this helps. If not, please set log level to TRACE and upload the log.
I do see FacetService#xmlToFacets occurs within a traced transaction (QESResultat_jsp#doGet) and not being traced. Your settings look fine, so I can't see what's wrong at the moment. Please upload the startup area of this log, where we log the active instrumentations and matchings, maybe we can find some hints there.
Looks like the agent doesn't find any type and method match to the CaptureSpanInstrumentation although it sees the application_packages properly set to com.qwam.
Please add the following code to the FacetService constructor, so we can see which class loader loads it:
Trying to guess where you were going I added the apm-agent-api-1.4.0.jar to Tomcat lib (it is currently in myapp/WEB-INF/lib) thinking that Tomcat should now the jar before the app, since APM is outside the app. But this does not change anything
The WEB-INF/lib should work just fine. Anyway, it seems it loaded the class from there even after you added to tomcat lib (which makes sense because the ParallelWebappClassLoader has the delegate: false setting, so it searches locally first). Did you add any other jar to WEB-INF/lib?
I added only apm-agent-api-1.4.0.jar in WEB-INF/lib.
I had an issue with netty.jar* that I had to add in $CATALINA_HOME/lib to avoid a strange NoClassDefFound despite they were in WEB-INF/lib.
That is all.
I could not reproduce the NoClassDefFound about netty jars that I had in the install.
But when I remove the netty jars from $CATALINA_HOME/lib, only relying on those which are in the WEB-INF/lib, I get JSP page error from Tomcat and nothing works anymore.
Here is the netty jar list:
Well, I can't say at the moment if this is related or not to the tracing failure you originally reported, but this is really bad. Normally you should just be able to add the API jar to your application and the java agent jar to your JVM startup and nothing else.
This log indeed says nothing related. If possible, please remove the elastic.apm.log_level setting (to restore to INFO level) and restore everything to the original state- your application and Tomcat original setup, Elastic API jar in the app lib and the javaagent in the JVM setup. Then clean the logs, start the app, make a few requests and upload the full log.
Eyal, please forget my last.
The Error 404 came from a developper who performed a buggy commit.
You were so fast to respond, that I did not have time to cancel my post.
We apologize for this Eyal.
I came back to the situation where the netty jar are removed from $CATALINA_HOME/lib with a fresh restart. I could not reproduce the NoCLassDefFound issue I had on netty during the install.
I will have to switch to something else in the next few days, so I won't be available.
I will be back in a week or so.
Do not worry if you did not solve my issue, I know it will work sooner or later.
APM is a great tool and we have already seen so many things and so many hints to improve performances of our app, even without the annotation working that, it showed us how wonderful and easy to set up it can be.
Thanks for the incredible feedback! It is great to know that you found it valuable!
Once you're back and available for that, we can start fresh and take it from there.
Cheers,
Eyal.
Trying to narrow down the issue, I installed everything on my desktop.
I have a Tomcat 9.0.5 there and for sure I am alone.
But I cannot get my application deployed on Tomcat.
Instead, I get and in the logs
Caused by: java.lang.LinkageError: loader (instance of org/apache/catalina/loader/ParallelWebappClassLoader): attempted duplicate class definition for name: "javax/ws/rs/Path"
Doesn't seem related to the agent. You may have the JAX-RS jar more than once on your application's classpath, for example - both in the tomcat/lib and the WEB-INF/lib.
Ahh, I see why we can cause that...
Can you set jax-rs in the instrumentation diablement configuration and see if the problem disappears? It's just a check, you seem to need this instrumentation, so I will create a fix once it is verified.
Still, I assume there is another jar with this class somewhere (maybe in jre-home/lib/ext?), so if you find such and can remove it, it may resolve the problem
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.