APM java agent do not support microservice framework (spring cloud)?

I use the elasticsearch/kibana/APM server 6.6 version, and APM java agent 1.3 version.

In my test, I use spring cloud (Greenwich.RELEASE) as the distributed micro service framework and use netflix eureka as the service registry center.

Here, I just show the consumer code:

@Controller
@RequestMapping( "/user" )
public class ConsumerController
{

    @Autowired
    UserRemote userRemote;



    @RequestMapping( "/get" )
    @ResponseBody
    public String getUserWithEureka()
    {
        return userRemote.getUser();
    }

    @RequestMapping( "/get2" )
    @ResponseBody
    public String indexWithUrl()
    {
        RestTemplate restTemplate = new RestTemplate();
        String results = restTemplate.getForObject("http://localhost:8001/user/showUser", String.class);
        return results;
    }
}

in above code, when I access api by /user/get, it will call the remote Restful API by eureka client. when I access api by /user/get2, it will directly get it by HTTP

I only deploy one micro service, so, these two way actually calling the same instance.

Two transaction are catch by apm agent. for the one directly call HTTP restful, it is able to do distributed trace:

for the one use eureka, it didn't:

do we have any plan to support spring cloud or dubbo?

Hi and thanks for the question :slight_smile:
Do you know which underlying HTTP client Eureka is using? Version 1.4.0 of the agent comes with support for OkHttp and HttpUrlConnection. There is also an issue for supporting the Apache Async HTTP client: https://github.com/elastic/apm-agent-java/issues/328

See also the list of currently supported networking frameworks: https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html#supported-networking-frameworks

Cheers,
Felix

1 Like

Hi, Sorry that I have no time to trace what what is the underlying HTTP client Eureka is using:

anyway, after I ungrade the agent to the latest 1.4 version, it is able to get the make distributed trace for eureka. Thanks!

3 Likes

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