# Elastic AEM not showing full trace

**URL:** <https://discuss.elastic.co/t/elastic-aem-not-showing-full-trace/236978>\
**Category:** APM\
**Tags:** java\
**Created:** [June 13, 2020, 1:31pm UTC](https://discuss.elastic.co/t/elastic-aem-not-showing-full-trace/236978 "2020-06-13T13:31:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Susmit07](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/susmit07/32/47309_2.png) [@Susmit07](https://discuss.elastic.co/u/Susmit07)\
**Post date:** [June 13, 2020, 1:31pm UTC](https://discuss.elastic.co/t/elastic-aem-not-showing-full-trace/236978/1 "2020-06-13T13:31:33Z")

</div>

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

The yellow highlighted portion is empty, it should be tracing other operation

Hi Team,

I am using AEM server to upload my system metric and visualize it in Kibana, I used few annotation like @CaptureSpan and @CaptureTransaction

My use case is i need to save the details to DB and if persistence is successful send an email via SMTP email server. My code looks like below:

Controller:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/9/f9c01db32bb449d87a749a37bf0e20c3bb03de2b.png)

Service:

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

DAO:

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

The @CaptureTransaction is working as expected but the span in service is not working it's only capturing RDBMS related information and not the latency of sending mail, how can i include that trace as well

@felixbarny @Brandon_Kobel

---

<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:** [June 15, 2020, 2:47am UTC](https://discuss.elastic.co/t/elastic-aem-not-showing-full-trace/236978/2 "2020-06-15T02:47:22Z")

</div>

Thanks for the question.  
Actually, based on the code and screenshot, it seems that neither annotation is working and what you get is based on the automatic tracing of Spring MVC and JDBC.  
Try removing your annotations and see if you get the same.  
If so, you need to remove the `@CaptureTransaction` annotation and figure out why you don't get your service's `shareFiles` span. Maybe your [`application_packages`](https://www.elastic.co/guide/en/apm/agent/java/current/config-stacktrace.html#config-application-packages) config is not set properly.  
In any case, once you get it to work, you can add a `@CaptureSpan` annotation to the `sendEmail` method to get a better visibility.  
I hope this helps.

---

<div class="post-metadata">

**Author:** ![Susmit07](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/susmit07/32/47309_2.png) [@Susmit07](https://discuss.elastic.co/u/Susmit07)\
**Post date:** [June 17, 2020, 7:16am UTC](https://discuss.elastic.co/t/elastic-aem-not-showing-full-trace/236978/3 "2020-06-17T07:16:43Z")

</div>

Hi @Eyal_Koren the things actually got resolved the same day itself but due to some work couldn't reply over here, I wasthinkingthe package scan actually allows \* if we scan any package like com.es.monitoring.\*, but it actually wont recognized, so I removed it and everything is working as expected.

But separate task is not being recognized

```auto
 @CaptureTransaction (type = Task)

```

---

<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 15, 2020, 7:16am UTC](https://discuss.elastic.co/t/elastic-aem-not-showing-full-trace/236978/4 "2020-07-15T07:16:50Z")

</div>

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