# APM Java Agent on Tomcat is not tracing method invocation from quartz threads on app

**URL:** <https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089>\
**Category:** APM\
**Tags:** java, server\
**Created:** [July 5, 2019, 11:45am UTC](https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089 "2019-07-05T11:45:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![inakipaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inakipaz/32/49503_2.png) [@inakipaz](https://discuss.elastic.co/u/inakipaz)\
**Post date:** [July 5, 2019, 11:45am UTC](https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089/1 "2019-07-05T11:45:09Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** : 7.0.0

**Elasticsearch version** : 7.0.0

**APM Server version** : 7.0.1

**APM Agent language and version** : JAVA 1.7.0  
Tomcat v8.5.30

**Fresh install or upgraded from other version?**  
Fresh Install

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.  
Tomcat setenv.sh:  
export CATALINA\_OPTS="$CATALINA\_OPTS -javaagent:/opt/apm/elastic-apm-agent-1.7.0.jar"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.service\_name=frm-service-des"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.application\_packages=com.example"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.server\_urls=http://localhost:8200"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.environment=des"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm\*\*.trace\_methods\*\*=com.example.app.service.job.\*Job#execute"

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
Jobs are executed through Quartz threads, not tomcat threads. In kibana, I expected to also see jobs transactions, however I only see HTTP transactions (index\_jsp#doGet).

**Steps to reproduce** :

1. On tomcat, deploy a war application with Quartz jobs and try to trace them.
2. 
3. 

**Errors in browser console (if relevant)**:

**Provide logs and/or server output (if relevant)**:  
Jobs execution is viewed on logs:  
INFO 2019-07-05 13:30:00,004 [scheduler\_Worker-2] com.example.app.service.job.IntegrationJob - Job \*\* Integration\_Job\_Detail \*\* fired @ Fri Jul 05 13:30:00 CEST 2019

However no trace appears on APM.

---

<div class="post-metadata">

**Author:** ![inakipaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inakipaz/32/49503_2.png) [@inakipaz](https://discuss.elastic.co/u/inakipaz)\
**Post date:** [July 5, 2019, 12:13pm UTC](https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089/2 "2019-07-05T12:13:25Z")

</div>

Found out how to debug agent and activated it. It is correctly getting traces. So navigated a little bit on Kibana and found out that transactions exist, but are not shown:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/2/e2274208fb00f43aaeada6d22d21ee0db9325778.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/d/7d7d78487a326922b0dacca06e7c5302b432cbb1.png)

Kibana problem?

---

<div class="post-metadata">

**Author:** ![inakipaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inakipaz/32/49503_2.png) [@inakipaz](https://discuss.elastic.co/u/inakipaz)\
**Post date:** [July 5, 2019, 12:47pm UTC](https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089/3 "2019-07-05T12:47:46Z")

</div>

Seen the filter on first image by type! Really confusing behavior and cannot select all. Anyway, problem "solved".

---

<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:** [July 7, 2019, 3:06am UTC](https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089/4 "2019-07-07T03:06:25Z")

</div>

Welcome to the forum and thanks for your feedback!

> [@inakipaz](#):
>
> export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.application\_packages=com.example"

No reason to do this- put a REAL root package of your application.

Regarding Quartz- guess what: @Wolfram_Haussig just created [a pull request implementing a plugin](https://github.com/elastic/apm-agent-java/pull/692) for capturing Quartz jobs out of the box!! If you can try it out and give us feedback- that will be awesome! You can download [this snapshot build](https://apm-ci.elastic.co/job/apm-agent-java/job/apm-agent-java-mbp/job/PR-692/22/artifact/src/github.com/elastic/apm-agent-java/elastic-apm-agent/target/elastic-apm-agent-1.7.1-SNAPSHOT.jar) and try it out (without the `-Delastic.apm.trace_methods=com.example.app.service.job.*Job#execute` configuration).

Thanks,  
Eyal.

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [July 8, 2019, 6:45am UTC](https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089/5 "2019-07-08T06:45:49Z")

</div>

@inakipaz As Eyal said I implemented Quartz support last week as we too are using Quartz and would like to see the Jobs in APM. I would appreciate any feedback on the implementation.

---

<div class="post-metadata">

**Author:** ![inakipaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inakipaz/32/49503_2.png) [@inakipaz](https://discuss.elastic.co/u/inakipaz)\
**Post date:** [July 8, 2019, 8:16am UTC](https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089/6 "2019-07-08T08:16:51Z")

</div>

@Eyal_Koren I used com.example to hide some data. It actually is the real package on the implementation.

@Wolfram_Haussig Just downloaded the snapshot and will test it on our dev environment. Will be back to comment on your github thread.

---

<div class="post-metadata">

**Author:** ![inakipaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inakipaz/32/49503_2.png) [@inakipaz](https://discuss.elastic.co/u/inakipaz)\
**Post date:** [July 8, 2019, 8:48am UTC](https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089/7 "2019-07-08T08:48:01Z")

</div>

@Wolfram_Haussig Just deployed and updated one tomcat with quartz. Works as expected. Stopped using trace\_methods.

---

<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:** [July 29, 2019, 4:48am UTC](https://discuss.elastic.co/t/apm-java-agent-on-tomcat-is-not-tracing-method-invocation-from-quartz-threads-on-app/189089/8 "2019-07-29T04:48:19Z")

</div>

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