I have a Spring Boot application which has an endpoint /serviceCall that makes REST call to an external endpoint (for example : http localhost:8200/config/v1/agents?service.name=demo-service) via RestTemplateA. This RestTemplateA has an interceptor which is used to get token via a Spring Component TokenService. TokenService has another RestTemplate that makes a request to another external endpoint (for example: http localhost:8200) to get a token and set it as header token to RestTemplateA call. This transaction is recorded by Elastic APM Java agent, however the first call to get token (http localhost:8200) is not in the span.
When I make token call directly via /directCall endpoint, same request is recorded as expected.
Is there a way to get the rest calls recorded when they are made from an ClientHttpRequestInterceptor instance? I shared a demo project on github
Kibana version: 8.16.1
Elasticsearch version: 8.16.1
APM Server version: 8.16.1
APM Agent language and version: Java 1.52.0
Browser version: Chrome
Original install method (e.g. download page, yum, deb, from source, etc.) and version: From Docker repository
Fresh install or upgraded from other version? Fresh Install on my local docker desktop environment
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.
Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
Steps to reproduce:
- Install and setup Elasticsearch, Kibana and APM Server as stated in APM Server binary | Elastic Observability [8.16] | Elastic
- Setup spring boot application on local development environment to send observation data to APM Server
-javaagent:elastic-apm-agent-1.52.0.jar
-Delastic.apm.service_name=demo-service
-Delastic.apm.secret_token=
-Delastic.apm.server_url=http://localhost:8200
-Delastic.apm.environment=ms-test
-Delastic.apm.application_packages=com.example.demo
Provide logs and/or server output (if relevant):