# End to end tracing is not shown

**URL:** <https://discuss.elastic.co/t/end-to-end-tracing-is-not-shown/276463>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [June 20, 2021, 12:11pm UTC](https://discuss.elastic.co/t/end-to-end-tracing-is-not-shown/276463 "2021-06-20T12:11:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![feroz-ahmmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/feroz-ahmmed/32/90562_2.png) [@feroz-ahmmed](https://discuss.elastic.co/u/feroz-ahmmed)\
**Post date:** [June 20, 2021, 12:11pm UTC](https://discuss.elastic.co/t/end-to-end-tracing-is-not-shown/276463/1 "2021-06-20T12:11:42Z")

</div>

**Kibana version** : 7.11.2

**Elasticsearch version** : 7.11.2

**APM Server version** : 7.11.2

**APM Agent language and version** : Elastic.Apm.AspNetCore@1.10.0

**Browser version** : Chrome 91.0.4472.77

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:

> **[Step 1: Install | APM Server Reference \[7.11\] | Elastic](https://www.elastic.co/guide/en/apm/server/7.11/installing.html)**

**Fresh install or upgraded from other version?**

Fresh install

**Is there anything special in your setup?**

Default configurations.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

I have two dotnet webapi services. Service1 calls Service2 via REST using the default HttpClient. Both of the requests to individual services can be found from APM section of kibana. However, full trace is not shown for the first request. In other words, I can not see that Service1 called Service2 in the request lifecycle.

 ![service1-details](https://us1.discourse-cdn.com/elastic/original/3X/b/c/bc249d832c839bebab0a342add5254b6a2c0453a.png)  
 ![service1-sample](https://us1.discourse-cdn.com/elastic/original/3X/c/9/c94e8bd2d18f44655fc6bd7f61a7dcacde71119e.png)  
 ![service2-details](https://us1.discourse-cdn.com/elastic/original/3X/c/0/c0bd83ee14b1ec1f50f67aa6bc351fbbf534114e.png)  
 ![service2-sample](https://us1.discourse-cdn.com/elastic/original/3X/0/9/099a5c115ca280a13edb5708c3fbdcf409a38e76.png)

I am expecting the end to end trace of the original request like this one -

 ![](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b36dec8432a712ccea74cb36ce4f5aa8ff170ede.png)

**Steps to reproduce** :

1. Clone the git repository [GitHub - feroz-ahmmed/elastic-apm-demo](https://github.com/feroz-ahmmed/elastic-apm-demo)
2. Set ElasticApm:ServerUrl and ElasticApm:SecretToken in the appsettings.json for both Service1 and Service2.
3. Run both services.
4. Send a Get request on /Service1 endpoint of Service1.
5. Find the request in APM section of kibana.

**Errors in browser console (if relevant)**:

**Provide logs and/or server output (if relevant)**:

---

<div class="post-metadata">

**Author:** ![feroz-ahmmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/feroz-ahmmed/32/90562_2.png) [@feroz-ahmmed](https://discuss.elastic.co/u/feroz-ahmmed)\
**Post date:** [July 8, 2021, 10:30am UTC](https://discuss.elastic.co/t/end-to-end-tracing-is-not-shown/276463/2 "2021-07-08T10:30:44Z")

</div>

Replying so that this thread doesn't get closed.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [July 20, 2021, 12:37am UTC](https://discuss.elastic.co/t/end-to-end-tracing-is-not-shown/276463/3 "2021-07-20T00:37:03Z")

</div>

Hi @feroz-ahmmed,

There's a couple of things that need to be addressed for this to work:

1. The service name for TracingService2 should be TracingService2 (or something else, but different from TracingService1). It's set to the same service name as TracingService1 in the example:

> <https://github.com/feroz-ahmmed/elastic-apm-demo/blob/48f0cf4780cdac458e033fc937da6056484a8490/TracingService2/Service2.Api/appsettings.json#L10>

1. The APM agent is not configured to trace HTTP calls. The `HttpDiagnosticsSubscriber` needs to passed to `app.UseElasticApm(Configuration, <subscribers here>)` in at least TracingService1, though you probably want to trace HTTP calls in both services, so add it to both in

> <https://github.com/feroz-ahmmed/elastic-apm-demo/blob/48f0cf4780cdac458e033fc937da6056484a8490/TracingService1/Service1.Api/Startup.cs#L33>

and

> <https://github.com/feroz-ahmmed/elastic-apm-demo/blob/48f0cf4780cdac458e033fc937da6056484a8490/TracingService2/Service2.Api/Startup.cs#L47>

i.e.

```auto
app.UseElasticApm(Configuration, new HttpDiagnosticsSubscriber());

```

With these changes, distributed tracing works

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

If you want to let the APM agent configure all subscribers, you can reference the [`Elastic.Apm.NetCoreAll` package](https://www.nuget.org/packages/Elastic.Apm.NetCoreAll/), and call

```auto
app.UseAllElasticApm(Configuration);

```

which will subcribe `HttpDiagnosticsSubscriber` along with many others ([see docs](https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-asp-net-core.html)). For 1.11.0, these are

> <https://github.com/elastic/apm-agent-dotnet/blob/1fb983d5a9a18f045f0c7c5d275f626ca6cd77a0/src/Elastic.Apm.NetCoreAll/ApmMiddlewareExtension.cs#L46-L57>

---

<div class="post-metadata">

**Author:** ![feroz-ahmmed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/feroz-ahmmed/32/90562_2.png) [@feroz-ahmmed](https://discuss.elastic.co/u/feroz-ahmmed)\
**Post date:** [July 25, 2021, 11:49am UTC](https://discuss.elastic.co/t/end-to-end-tracing-is-not-shown/276463/4 "2021-07-25T11:49:22Z")

</div>

HI @forloop ,  
Sorry for late reply. I tried your proposed changes changes and now I can see the end to end request trace.

Thanks for your time and detailed reply.

---

<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:** [August 15, 2021, 7:50am UTC](https://discuss.elastic.co/t/end-to-end-tracing-is-not-shown/276463/5 "2021-08-15T07:50:02Z")

</div>

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