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

**URL:** <https://discuss.elastic.co/t/apm-java-agent-do-not-support-microservice-framework-spring-cloud/168550>\
**Category:** APM\
**Created:** [February 15, 2019, 8:53am UTC](https://discuss.elastic.co/t/apm-java-agent-do-not-support-microservice-framework-spring-cloud/168550 "2019-02-15T08:53:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldcodeoberyn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oldcodeoberyn/32/24800_2.png) [@oldcodeoberyn](https://discuss.elastic.co/u/oldcodeoberyn)\
**Post date:** [February 15, 2019, 8:53am UTC](https://discuss.elastic.co/t/apm-java-agent-do-not-support-microservice-framework-spring-cloud/168550/1 "2019-02-15T08:53:56Z")

</div>

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:

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c7dcdc46bf1313d94233d8f0b5678cce3a81d8c2.png)

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/2/d298498b35e0043a14d80f98ee100051e4df601e.png)

for the one use eureka, it didn't:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/0/f0dfe8ba350b981d1dd0a4af59d6698115f0f6ff.png)

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

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [February 15, 2019, 11:07am UTC](https://discuss.elastic.co/t/apm-java-agent-do-not-support-microservice-framework-spring-cloud/168550/2 "2019-02-15T11:07:43Z")

</div>

Hi and thanks for the question 🙂  
Do you know which underlying HTTP client Eureka is using? [Version 1.4.0](https://github.com/elastic/apm-agent-java/releases/tag/v1.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](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](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html#supported-networking-frameworks)

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![oldcodeoberyn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oldcodeoberyn/32/24800_2.png) [@oldcodeoberyn](https://discuss.elastic.co/u/oldcodeoberyn)\
**Post date:** [February 16, 2019, 3:09am UTC](https://discuss.elastic.co/t/apm-java-agent-do-not-support-microservice-framework-spring-cloud/168550/3 "2019-02-16T03:09:01Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/e/6e7e9f1bbe1592911772d3f68db6ceb8c1eabc4f.png)

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4a22d5b8594b68bb9f7bb767003d3b8d28c96ed7.png)

---

<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:** [March 8, 2019, 11:09pm UTC](https://discuss.elastic.co/t/apm-java-agent-do-not-support-microservice-framework-spring-cloud/168550/4 "2019-03-08T23:09:03Z")

</div>

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