# Highly Custom Distributed Tracing?

**URL:** <https://discuss.elastic.co/t/highly-custom-distributed-tracing/187206>\
**Category:** APM\
**Tags:** nodejs\
**Created:** [June 25, 2019, 12:03am UTC](https://discuss.elastic.co/t/highly-custom-distributed-tracing/187206 "2019-06-25T00:03:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [June 25, 2019, 9:31am UTC](https://discuss.elastic.co/t/highly-custom-distributed-tracing/187206/2 "2019-06-25T09:31:01Z")

</div>

Hi Brandon

Thanks for trying out Elastic APM 🙂

The Node.js agent will automatically continue a distributed trace if it's coming in over HTTP/HTTPS. For all other protocols, such as WebSocket, you need to manually encode and decode the metadata needed to continue the trace when sending data between services.

Check out this answer for more details on how to do this:

> [@Full trace with custom integration](https://discuss.elastic.co/t/full-trace-with-custom-integration/185996/2):
>
> Welcome to the forum slight_smile Yes, you can link the two transactions together into one trace by ensuring that you pass on the current traceparent from the outgoing service (service A) and read it again in the receiving service (service B). This happens automatically with HTTP based services, but if you use raw TCP or UDP, you need to pass this information along manually. I assume you use the agent API to manually start a new transaction in service A. During an active transaction, you can…

If you have any other questions, don't hesitate to ask!

Best,  
Thomas

---

_[View the full topic](https://discuss.elastic.co/t/highly-custom-distributed-tracing/187206)._
