# Dynatrace distributed tracing with Kafka

**URL:** <https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840>\
**Category:** Open Q&A\
**Tags:** distributed-traces-classic, kafka\
**Created:** [December 30, 2019, 3:00pm UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840 "2019-12-30T15:00:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sean\_cheevers](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@sean\_cheevers](https://community.dynatrace.com/u/sean_cheevers)\
**Post date:** [December 30, 2019, 3:00pm UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/1 "2019-12-30T15:00:14Z")

</div>

I have an architecture which consists of producers and consumers with a Kafka broker in the middle. I have enabled the Dynatrace Kafka plugin which has provided some great additional information on monitoring the broker itself.

The current issue is the trace gets lost when a message is published to Kafka. I would like to the ability to see trace from a producer to a consumer in the service flow.

Does Dynatrace support this out of the box or is there some additional configuration required? I would like to hear if anyone has implemented something similar.

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [December 30, 2019, 5:12pm UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/2 "2019-12-30T17:12:46Z")

</div>

It’s not supported at all right now. I don’t know if there is any option to develop such tracing using current development tools we have. You can post a RFE for such case.

Sebastian

---

<div class="post-metadata">

**Author:** ![sean\_cheevers](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@sean\_cheevers](https://community.dynatrace.com/u/sean_cheevers)\
**Post date:** [December 30, 2019, 7:40pm UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/3 "2019-12-30T19:40:16Z")

</div>

[@Sebastian K.](https://answers.dynatrace.com/users/15061/view.html) Thanks for the quick response!

Complete lack of knowledge on Dynatrace, would it be possible to instrument the client with code to push the tace data to one agent or through the Dynatrace server api?

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [December 31, 2019, 9:07am UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/4 "2019-12-31T09:07:22Z")

</div>

Problem with instrumenting kafka would be overhead. This soft is processing massive amount of fast requests. What should be done is detecting somehow communicates that are going to Kafka and returining from them. I don’t know if this is possible but this is how Dynatrace is for example tagging messages that are going through IBM Integration bus. There is SDK for tagging MQ requests for unsupported bus, but this will not work for Kafka I suppose (different type of communication). This is something Dynatrace should do (if this is possible). This is why I suggested produce idea.

Sebastian

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [January 7, 2020, 12:30pm UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/5 "2020-01-07T12:30:16Z")

</div>

I think the Kafka support was mentioned by [@Andreas G.](https://answers.dynatrace.com/users/2960/view.html) in one of the recent performance clinics (I just don’t remember which one).

Last time I checked it was not generally available but I think it was being worked on since I’ve seen Kafka tracing code in oneagent java libraries.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [January 8, 2020, 2:17pm UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/6 "2020-01-08T14:17:48Z")

</div>

Just found it, seems to be an early access program (probably not public yet).  
See video at the [40:07 mark](https://youtu.be/CFmdUdbptUg?t=2407).

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [January 8, 2020, 3:32pm UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/7 "2020-01-08T15:32:32Z")

</div>

Cool! thx for info

---

<div class="post-metadata">

**Author:** ![janusz\_dabrowsk](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/janusz_dabrowsk/32/17325_2.png) [@janusz\_dabrowsk](https://community.dynatrace.com/u/janusz_dabrowsk)\
**Post date:** [April 27, 2020, 9:19am UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/8 "2020-04-27T09:19:12Z")

</div>

Hi  
Here’s description how to configure Kafka consumer to detect flows across Kafka messaging system

> **[Custom messaging services](https://docs.dynatrace.com/docs/observe/application-observability/services-classic/service-detection/service-detection-v1/service-types/define-messaging-services)**
>
> Set up custom messaging services to trace message queues.

---

<div class="post-metadata">

**Author:** ![janusz\_dabrowsk](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/janusz_dabrowsk/32/17325_2.png) [@janusz\_dabrowsk](https://community.dynatrace.com/u/janusz_dabrowsk)\
**Post date:** [April 27, 2020, 9:20am UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/9 "2020-04-27T09:20:12Z")

</div>

Here’s description how to configure Kafka consumer to detect flows across Kafka messaging system

> **[Custom messaging services](https://docs.dynatrace.com/docs/observe/application-observability/services-classic/service-detection/service-detection-v1/service-types/define-messaging-services)**
>
> Set up custom messaging services to trace message queues.

---

<div class="post-metadata">

**Author:** ![Kishogembali](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@Kishogembali](https://community.dynatrace.com/u/Kishogembali)\
**Post date:** [April 19, 2023, 4:31pm UTC](https://community.dynatrace.com/t/dynatrace-distributed-tracing-with-kafka/22840/10 "2023-04-19T16:31:35Z")

</div>

Hi Janusz,

Thanks for the link -&nbsp;[Custom messaging services — Dynatrace Docs](https://www.dynatrace.com/support/help/platform-modules/applications-and-microservices/services/service-detection-and-naming/service-types/define-messaging-services). I was going through this and made the code changes as per the sample given in node.js tab. But, while configuring the settings at Dynatrace, after selecting the handler file, Dynatrace is unable to find the method and then we are not able to move forward. Do you have any idea and help us how to move forward from here ?
