# APM - distirubted tracing in microservice-architectures

**URL:** <https://discuss.elastic.co/t/apm-distirubted-tracing-in-microservice-architectures/255970>\
**Category:** APM\
**Created:** [November 19, 2020, 11:21am UTC](https://discuss.elastic.co/t/apm-distirubted-tracing-in-microservice-architectures/255970 "2020-11-19T11:21:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristianB](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@ChristianB](https://discuss.elastic.co/u/ChristianB)\
**Post date:** [November 19, 2020, 11:21am UTC](https://discuss.elastic.co/t/apm-distirubted-tracing-in-microservice-architectures/255970/1 "2020-11-19T11:21:50Z")

</div>

Hello everyone.

I really like APM and what you can do with it, but in my opinion there is something missing when it comes to distributed tracing in a microservices architeture. This is due to the fact, that traces are not objects themselves, but just a grouping of transactions. When you now have a system consisting of distributed services, each contributing to a trace with seperate transactions, there is (to my knowledge) no way how to monitor the complete end-to-end workflow. You can for example set alarms for individual services, but not for the whole set of services.

> <https://github.com/elastic/apm-agent-dotnet/issues/701>
>
> Is your feature request related to a problem? Please describe.
> We have many micro services, spanning different processes and they are not...

This is also discussed in this github-issue, I describe the same problem in the last post. Since the issue has been closed for a while now, I also wanted to open a discussion here. I would be really interested what others think about this topic.

---

<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:** [November 19, 2020, 2:10pm UTC](https://discuss.elastic.co/t/apm-distirubted-tracing-in-microservice-architectures/255970/2 "2020-11-19T14:10:52Z")

</div>

One thing that you could do as a workaround is to take a timestamp in Service 1 and add it to the message that gets propagated to service 2 and 3. Just before Service 3 finishes the work, you can calculate the total trace duration and set the value as a [label](https://www.elastic.co/guide/en/apm/agent/dotnet/current/public-api.html#api-transaction-set-label). You can then alert based on this custom label.

---

<div class="post-metadata">

**Author:** ![ChristianB](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@ChristianB](https://discuss.elastic.co/u/ChristianB)\
**Post date:** [November 20, 2020, 11:21am UTC](https://discuss.elastic.co/t/apm-distirubted-tracing-in-microservice-architectures/255970/3 "2020-11-20T11:21:22Z")

</div>

Thanks Felix, I was able to implement everything like you suggested. The alerting and reporting now works excactly like we need it.

---

<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:** [November 20, 2020, 11:47am UTC](https://discuss.elastic.co/t/apm-distirubted-tracing-in-microservice-architectures/255970/4 "2020-11-20T11:47:09Z")

</div>

That's great to hear 🎉

---

<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:** [December 11, 2020, 7:47am UTC](https://discuss.elastic.co/t/apm-distirubted-tracing-in-microservice-architectures/255970/5 "2020-12-11T07:47:18Z")

</div>

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