# Distributed Tracing through an API Gateway

**URL:** <https://discuss.elastic.co/t/distributed-tracing-through-an-api-gateway/251146>\
**Category:** APM\
**Tags:** java\
**Created:** [October 6, 2020, 2:32pm UTC](https://discuss.elastic.co/t/distributed-tracing-through-an-api-gateway/251146 "2020-10-06T14:32:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethranes](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@ethranes](https://discuss.elastic.co/u/ethranes)\
**Post date:** [October 6, 2020, 2:32pm UTC](https://discuss.elastic.co/t/distributed-tracing-through-an-api-gateway/251146/1 "2020-10-06T14:32:04Z")

</div>

TIP 1: select at least one tag that further categorizes your topic. For example `server` for APM Server related questions, `java` for questions regarding the Elastic APM Java agent, or `ui` for questions about the APM App within Kibana.

TIP 2: Check out the [troubleshooting guide](https://www.elastic.co/guide/en/apm/get-started/current/troubleshooting.html) first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

**Kibana version** : 7.5.1

**Elasticsearch version** : 7.5.1

**APM Agent language and version** : Java 1.6.1

I will be introducing an API Gateway as part of my stack, and I'd like to know what additional setup I'd need to do to get distributed tracing working. At the moment I have APM setup for both my backend and frontend servers and I'm getting transactions fine.

With the introduction of the API Gateway, is it enough that I add the apm agent to that server and start it up with the gateway (similar to how I have my existing services setup). Or is there any additional steps that I'd need to take?

I can't find much info on this in the docs, apart from possibly having to add a new property to my properties file

---

<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:** [October 6, 2020, 4:42pm UTC](https://discuss.elastic.co/t/distributed-tracing-through-an-api-gateway/251146/2 "2020-10-06T16:42:31Z")

</div>

If the API Gateway is using [supported technologies](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html), distributed tracing should work out-of-the-box by just attaching the agent to both applications.

---

<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 27, 2020, 12:42pm UTC](https://discuss.elastic.co/t/distributed-tracing-through-an-api-gateway/251146/3 "2020-10-27T12:42:33Z")

</div>

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