I am not being able to audit the transactions against my Vert.x application using the Java agent for this purpose, even though I have enabled the experimental instrumentations.
The agent successfully sends JVM metrics to the APM Server.
I enabled TRACE as you suggested and nothing is logged when I send HTTP requests for the application.
I noticed, although, errors when the agent was trying to create some specific threads. The stack trace is always as following, except the name of the thread:
2023-03-16 15:47:59,378 [main] DEBUG co.elastic.apm.agent.util.ExecutorUtils - A new thread named `elastic-apm-configuration-reloader` was created. The original context class loader of this thread (jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7) has been overridden
2023-03-16 15:47:59,382 [main] TRACE co.elastic.apm.agent.util.ExecutorUtils - Stack trace related to thread creation:
java.lang.Throwable: null
at co.elastic.apm.agent.util.ExecutorUtils.logThreadCreation(ExecutorUtils.java:141) [elastic-apm-agent-1.36.0.jar:1.36.0]
at co.elastic.apm.agent.util.ExecutorUtils$SingleNamedThreadFactory.newThread(ExecutorUtils.java:130) [elastic-apm-agent-1.36.0.jar:1.36.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.<init>(ThreadPoolExecutor.java:630) [?:?]
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:920) [?:?]
at java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1593) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:346) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(ScheduledThreadPoolExecutor.java:632) [?:?]
at co.elastic.apm.agent.impl.ElasticApmTracerBuilder.scheduleReloadAtRate(ElasticApmTracerBuilder.java:197) [elastic-apm-agent-1.36.0.jar:1.36.0]
at co.elastic.apm.agent.impl.ElasticApmTracerBuilder.build(ElasticApmTracerBuilder.java:153) [elastic-apm-agent-1.36.0.jar:1.36.0]
at co.elastic.apm.agent.impl.ElasticApmTracerBuilder.build(ElasticApmTracerBuilder.java:133) [elastic-apm-agent-1.36.0.jar:1.36.0]
at co.elastic.apm.agent.bci.ElasticApmAgent.initialize(ElasticApmAgent.java:162) [elastic-apm-agent-1.36.0.jar:1.36.0]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at co.elastic.apm.agent.premain.AgentMain.loadAndInitializeAgent(AgentMain.java:161) [elastic-apm-agent-1.36.0.jar:1.36.0]
at co.elastic.apm.agent.premain.AgentMain.init(AgentMain.java:102) [elastic-apm-agent-1.36.0.jar:1.36.0]
at co.elastic.apm.agent.premain.AgentMain.premain(AgentMain.java:51) [elastic-apm-agent-1.36.0.jar:1.36.0]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491) [?:?]
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503) [?:?]
I also tried to downgrade the Vert.x version to 3.9.15 by downgrading the Quarkus version. No transactions either.
I also tried using the public API by adding the apm-agent-api:1.39.0 dependency, but the annotations didn't work and also the result of any ElasticApm.startSomething() was a noop entity.
TRACE is too detailed, use DEBUG. If you are using annotations, you need to set the application_packages or the annotations are ignored (per the documentation)
Yes, I send HTTP requests to my application. The application responds the requests, but the transactions are not being created by the agent(no logging about the agent starting transactions).
Any chance you guys have an example of a working Java agent on a Vert.x Web application?
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.