# APM Java agent not creating transactions with Vert.x even with experimental features enabled

**URL:** <https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873>\
**Category:** APM\
**Tags:** java\
**Created:** [March 16, 2023, 5:52pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873 "2023-03-16T17:52:43Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![missael.denadai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/missael.denadai/32/118538_2.png) [@missael.denadai](https://discuss.elastic.co/u/missael.denadai)\
**Post date:** [March 16, 2023, 5:52pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/1 "2023-03-16T17:52:43Z")

</div>

Hi!

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.

```auto
-Dquarkus.profile=local
-javaagent:src/main/resources/elastic-apm-agent-1.36.0.jar
-Delastic.apm.secret_token=TOKEN
-Delastic.apm.service_name=get-started
-Delastic.apm.server_url=SERVER_ENDPOINT
-Delastic.apm.enable_experimental_instrumentations=true

```

It's auditing the app metrics but no transactions.  
The application logs also don't mention any transaction being created.

The versions are:

```auto
APM Java Agent: 1.36.0
Vert.x Web: 4.3.7
Java: 
- Java 11.0.17 Runtime version: 11.0.17+8 VM version: 11.0.17+8 (Eclipse Adoptium) 
- Java 17.0.6 Runtime version: 17.0.6+9-LTS-190 VM version: 17.0.6+9-LTS-190 (Oracle Corporation)

```

Do you have any idea what the problem could be?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [March 16, 2023, 6:11pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/2 "2023-03-16T18:11:09Z")

</div>

Hi @missael.denadai welcome to the community!

Try enabling DEBUG or TRACE and looking closely at the agent logs (which will be part of the app logs)

Is the agent successfully connecting to the APM SERVER?  
Are there JVM Metrics showing up in Kibana?

`-Delastic.apm.log_level=DEBUG`

---

<div class="post-metadata">

**Author:** ![missael.denadai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/missael.denadai/32/118538_2.png) [@missael.denadai](https://discuss.elastic.co/u/missael.denadai)\
**Post date:** [March 16, 2023, 7:00pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/3 "2023-03-16T19:00:04Z")

</div>

Hi @stephenb thank you for replying.

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:

```auto
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.

Any leads?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [March 16, 2023, 7:11pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/4 "2023-03-16T19:11:40Z")

</div>

> [@missael.denadai](#):
>
> Any leads?

Well, it is experimental 🙂

Not immediate ... and many of the Engineers are in a Conference I will try to ping one but I suspect he will not be able to look until next week.

@Eyal_Koren Any Thoughts?

---

<div class="post-metadata">

**Author:** ![Jack\_Shirazi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_shirazi/32/91641_2.png) [@Jack\_Shirazi](https://discuss.elastic.co/u/Jack_Shirazi)\
**Post date:** [March 16, 2023, 8:24pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/5 "2023-03-16T20:24:54Z")

</div>

TRACE is too detailed, use DEBUG. If you are using [annotations](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-annotation), you need to set the [application\_packages](https://www.elastic.co/guide/en/apm/agent/java/current/config-stacktrace.html#config-application-packages) or the annotations are ignored (per the documentation)

---

<div class="post-metadata">

**Author:** ![Jack\_Shirazi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_shirazi/32/91641_2.png) [@Jack\_Shirazi](https://discuss.elastic.co/u/Jack_Shirazi)\
**Post date:** [March 16, 2023, 8:26pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/6 "2023-03-16T20:26:35Z")

</div>

The vert.x instrumentation `Captures incoming HTTP requests as transactions` do you have any of those incoming requests?

---

<div class="post-metadata">

**Author:** ![missael.denadai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/missael.denadai/32/118538_2.png) [@missael.denadai](https://discuss.elastic.co/u/missael.denadai)\
**Post date:** [March 16, 2023, 9:56pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/7 "2023-03-16T21:56:45Z")

</div>

Hi @Jack_Shirazi , thank you for your reply.

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?

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [March 20, 2023, 8:13am UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/8 "2023-03-20T08:13:49Z")

</div>

Looks like you are using Quarkus. Do you use it in a native image mode?

---

<div class="post-metadata">

**Author:** ![missael.denadai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/missael.denadai/32/118538_2.png) [@missael.denadai](https://discuss.elastic.co/u/missael.denadai)\
**Post date:** [March 20, 2023, 12:16pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/9 "2023-03-20T12:16:58Z")

</div>

Hi @Eyal_Koren  
No, we are not using the native compilation.

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [March 20, 2023, 1:16pm UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/10 "2023-03-20T13:16:42Z")

</div>

Can you see the following line in your `DEBUG` log:

```auto
Method match for instrumentation VertxTracerReceiveRequestInstrumentation

```

?

> [@missael.denadai](#):
>
> Any chance you guys have an example of a working Java agent on a Vert.x Web application?

If [VertxServerTest](https://github.com/elastic/apm-agent-java/blob/1ebf63cff72ef524468112ded8ef5b4160f65796/apm-agent-plugins/apm-vertx/apm-vertx4-plugin/src/test/java/co/elastic/apm/agent/vertx/v4/VertxServerTest.java) is not what you are looking for, look for other tests in the area.

There is also a [PR](https://github.com/elastic/apm-agent-java/pull/1765) with Quarkus tests, which is not up-to-date but shows that we generally support it, with a [small modification required](https://github.com/elastic/apm-agent-java/issues/2981).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 10, 2023, 9:17am UTC](https://discuss.elastic.co/t/apm-java-agent-not-creating-transactions-with-vert-x-even-with-experimental-features-enabled/327873/11 "2023-04-10T09:17:15Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
