Kibana/Elasticsearch version:
Stack 7.17.0
APM Agent language and version:
1.28.4 java
Original install method (e.g. download page, yum, deb, from source, etc.) and version:
Download page and local setup
Is there anything special in your setup?
We use third-party software components
Description of problem
Hi,
I have problem that REST calls by Spring template are not captured by APM Agent in our application.
This application use third-party software component for messaging. This part of code is not Instrumented by java APM Agent. In some places this messaging system make REST calls by RestTemplate. Instrumentation in apm-spring-resttemplate is executed, but Span is not created because, previously no parent Transaction was created.
What I want to achieve is that Transaction will be created only when REST call is executed.
Question is what I can do to fix this ?
I think about own plugin that will Instrumented this custom messaging library. Problem is that Transaction will be created for all messages, it does not matter if there is REST call or not (we want track only REST calls).
Other idea is create own plugin that will Instrument co.elastic.apm.agent.resttemplate.SpringRestTemplateAdvice and create Transaction before Advice will be lunched. I can create Transacion before SpringRestTemplateAdvice.beforeExecute() is executed but I don know how to deactivate created Transaction after SpringRestTemplateAdvice.afterExecute(). To handle "SpringRestTemplateAdvice.beforeExecute()" to create and active Transaction and "SpringRestTemplateAdvice.afterExecute()" to deactivate Transaction I need 2 different Advice class and I don't know how to transfer created Transaction between them. Maybe you can suggest something ?
Thank you for help!