Unable to trace DAO methods

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

I assume it's not a supported technology, (as then it should be captured). So you can explicitly trace methods to capture the specific methods you want to track

@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.

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?

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

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.

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