# Unable to trace DAO methods

**URL:** <https://discuss.elastic.co/t/unable-to-trace-dao-methods/330814>\
**Category:** APM\
**Tags:** java\
**Created:** [April 26, 2023, 9:38am UTC](https://discuss.elastic.co/t/unable-to-trace-dao-methods/330814 "2023-04-26T09:38:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)\
**Post date:** [April 26, 2023, 9:38am UTC](https://discuss.elastic.co/t/unable-to-trace-dao-methods/330814/1 "2023-04-26T09:38:01Z")

</div>

Hi,

I am using a java MVC Based application built on jdk 17 version.  
After configuring the ELK agent with application and checking the stacktraces, Its observed that some methods are not captured in the transaction spans.  
Example:  
I have a Implementation clas AbcImpl.java which has method xyz().  
The method xyz() , in its implementation has a dao.findbyName() method. This dao is annotated with @Autowired . The DAO Interface ,which is annotated with @Repository **extends CrudRepository and has the interface method findbyName().**

In the agent stack trace, although I am able to capture the traces for rest of the methods the dao method **findbyName()** are not captured in the stacktraces.

Is there any way we can track these repository methods?

Please advise.

Thanks & Regards,  
Namita Jaokar

---

<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:** [April 26, 2023, 1:46pm UTC](https://discuss.elastic.co/t/unable-to-trace-dao-methods/330814/2 "2023-04-26T13:46:14Z")

</div>

I assume it's not a [supported technology](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html), (as then it should be captured). So you can explicitly [trace methods](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-trace-methods) to capture the specific methods you want to track

---

<div class="post-metadata">

**Author:** ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)\
**Post date:** [May 3, 2023, 2:26pm UTC](https://discuss.elastic.co/t/unable-to-trace-dao-methods/330814/3 "2023-05-03T14:26:05Z")

</div>

@Jack_Shirazi Thanks. Configuring trace\_methods gave me the custom methods that were getting filtered initially. But this did not provide me the DAO methods like findById() ,findByName() etc.

---

<div class="post-metadata">

**Author:** ![Jonas\_Kunz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_kunz/32/110740_2.png) [@Jonas\_Kunz](https://discuss.elastic.co/u/Jonas_Kunz)\
**Post date:** [May 4, 2023, 8:39am UTC](https://discuss.elastic.co/t/unable-to-trace-dao-methods/330814/4 "2023-05-04T08:39:14Z")

</div>

I think the problem here is that the actual implementation of the `@Repository` interface is a spring-generated proxy class, which we exclude from instrumentation.

Could you provide the name of the spring-generated implementation for your `@Repository` interface (e.g. based on a stacktrace), so that I can verify this?

---

<div class="post-metadata">

**Author:** ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)\
**Post date:** [May 5, 2023, 9:29am UTC](https://discuss.elastic.co/t/unable-to-trace-dao-methods/330814/5 "2023-05-05T09:29:31Z")

</div>

Hi @Jonas_Kunz ,

Apologies , But I did not get what I need to provide?

Are you asking for the stacktrace of the Request having the DAO call?

Best Regards,  
Namita

---

<div class="post-metadata">

**Author:** ![Jonas\_Kunz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_kunz/32/110740_2.png) [@Jonas\_Kunz](https://discuss.elastic.co/u/Jonas_Kunz)\
**Post date:** [May 5, 2023, 10:19am UTC](https://discuss.elastic.co/t/unable-to-trace-dao-methods/330814/6 "2023-05-05T10:19:05Z")

</div>

I would need the name of the class implementing your `@Repository` interface.  
E.g. in a class where your respository is injected via `@Autowired` invoke `.getClass().getName()` on the autowired repository instance and post the result here. This will be the name of the spring-generated class implementing your `@Repository` interface.

---

<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:** [May 26, 2023, 6:20am UTC](https://discuss.elastic.co/t/unable-to-trace-dao-methods/330814/7 "2023-05-26T06:20:00Z")

</div>

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