# APM tracing with ZUUL (Netflix OSS)

**URL:** <https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838>\
**Category:** APM\
**Tags:** java\
**Created:** [September 10, 2019, 7:36am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838 "2019-09-10T07:36:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![pabloborh](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@pabloborh](https://discuss.elastic.co/u/pabloborh)\
**Post date:** [September 10, 2019, 7:36am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/1 "2019-09-10T07:36:08Z")

</div>

**Kibana version** : 7.0.1

**Elasticsearch version** : 7.0.1

**APM Server version** : 7.0.1

**APM Agent language and version** : apm agent 1.7.0 on java 10

I have some micro-services with netflix OSS service. When I use ZUUL the APM can't differentiate between different request.

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

There are some possible workaround for differentiate ZuulController requests?

> **[Netflix/zuul](https://github.com/Netflix/zuul)**
>
> Zuul is a gateway service that provides dynamic routing, monitoring, resiliency, security, and more. - Netflix/zuul

Regards,

---

<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:** [September 10, 2019, 7:52am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/2 "2019-09-10T07:52:08Z")

</div>

How would you ideally like the transactions to be named after?

You can use the public API to manually name the transactions: [https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-set-name](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#api-set-name)

---

<div class="post-metadata">

**Author:** ![pabloborh](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@pabloborh](https://discuss.elastic.co/u/pabloborh)\
**Post date:** [September 10, 2019, 8:21am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/3 "2019-09-10T08:21:41Z")

</div>

The problem is that ZuulController is the class where all requests are going on. There are a lot of different request addressed to different micro-services.

So you're saying, for example, we can add a transaction.setName before zuulController call for naming all request. Rigth?

Thanks

---

<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:** [September 11, 2019, 1:46pm UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/4 "2019-09-11T13:46:25Z")

</div>

> [@pabloborh](#):
>
> So you're saying, for example, we can add a transaction.setName before zuulController call for naming all request. Rigth?

Yes, for example in a filter or an interceptor

How would you ideally like the transactions to be named after?

---

<div class="post-metadata">

**Author:** ![pabloborh](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@pabloborh](https://discuss.elastic.co/u/pabloborh)\
**Post date:** [September 11, 2019, 3:17pm UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/5 "2019-09-11T15:17:20Z")

</div>

> [@felixbarny](#):
>
> How would you ideally like the transactions to be named after?

I have not an easy answer for that, at zuulController level We have not much information.  
For example the URL path could be useful but in our case We use UIDs in some URL paths, for us it will be a problem, but could be an approach.

The rest of request (outside zuulController) apm instrumentation give us the java method, that's perfect but i'm not sure if it is possible

---

<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:** [September 12, 2019, 7:45am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/6 "2019-09-12T07:45:12Z")

</div>

Could you have a look at the [`use_path_as_transaction_name`](https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-use-path-as-transaction-name) and [`url_groups`](https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-url-groups) options? Would that be sufficient for your purposes?

Note that currently, the `ZuulController` transaction name would take precedence, even when enabling these options. I have created [https://github.com/elastic/apm-agent-java/issues/838](https://github.com/elastic/apm-agent-java/issues/838) to change that.

---

<div class="post-metadata">

**Author:** ![pabloborh](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@pabloborh](https://discuss.elastic.co/u/pabloborh)\
**Post date:** [September 13, 2019, 7:18am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/7 "2019-09-13T07:18:41Z")

</div>

I did some probes. With use\_path\_as\_transaction\_name transactions has not distributed tracing.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/6/866bab13f43d0b75a6d90a9ce9f54f9f286c4291.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/0/e011a0b3ba82cd4d77d49f9195d3c687e13e81cc.png)

PD thanks for open git issue!

---

<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:** [September 13, 2019, 9:35am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/8 "2019-09-13T09:35:05Z")

</div>

`use_path_as_transaction_name` does not affect distributed tracing. Are you sure DT worked for this particular transaction when `use_path_as_transaction_name` was `false`?

---

<div class="post-metadata">

**Author:** ![pabloborh](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@pabloborh](https://discuss.elastic.co/u/pabloborh)\
**Post date:** [September 13, 2019, 10:16am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/9 "2019-09-13T10:16:59Z")

</div>

url\_path--\>  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c759494f04187b5dfbe00902bb9032bd6e6cadf7.png)  
Through ZuulController --\>  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7f981ced88ae728708c6a1804a13ab823efa1f13.png)

Full path  
(first screen)  
/platform-notification-service/v1/api/notifications/search/findByUserIdAndNotificationTypeAndNotificationStatus?userId=44929069-0cd3-4022-95ef-8e2dfa501943&notificationType=NOTIFICATION&notificationStatus=PENDING&projection=full&sort=creationDate,desc&size=50&page=0

(second screen)  
platform-notification-service/v1/api/notifications/search/findByUserIdAndNotificationTypeAndNotificationStatus?userId=54e0364c-1846-4497-9e92-b1f2aa807b11&notificationType=ALERT&notificationStatus=VIEWED&projection=full&sort=creationDate,desc&size=48&page=0

GET--\>  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/d/ad31846f702757086b9a721af517fc5668419dd8.png)

99.9% of request sampled (with use\_path\_as\_transaction\_name) are flagged as OPTIONS only the last one is GET but even this one has not DT

The expected behaviour is same requests grouped in ZuulController sampled as path?

---

<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:** [September 13, 2019, 11:58am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/10 "2019-09-13T11:58:31Z")

</div>

The first request is an HTTP `OPTIONS` request. It does, in fact, not call the `platform-notification-service`.

---

<div class="post-metadata">

**Author:** ![pabloborh](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@pabloborh](https://discuss.elastic.co/u/pabloborh)\
**Post date:** [September 16, 2019, 11:17am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/11 "2019-09-16T11:17:46Z")

</div>

> [@felixbarny](#):
>
> The first request is an HTTP `OPTIONS` request. It does, in fact, not call the `platform-notification-service` .

I've edited last post

---

<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:** [September 16, 2019, 11:48am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/12 "2019-09-16T11:48:03Z")

</div>

Only after [https://github.com/elastic/apm-agent-java/issues/838](https://github.com/elastic/apm-agent-java/issues/838) is resolved the path would take precedence over the `ZuulController` name, even if `use_path_as_transaction_name=true`.

---

<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:** [October 7, 2019, 8:02am UTC](https://discuss.elastic.co/t/apm-tracing-with-zuul-netflix-oss/198838/13 "2019-10-07T08:02:41Z")

</div>

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