# End to end latency with traces

**URL:** <https://discuss.elastic.co/t/end-to-end-latency-with-traces/338452>\
**Category:** APM\
**Tags:** elastic-stack-monitoring, agent-explorer\
**Created:** [July 15, 2023, 8:19am UTC](https://discuss.elastic.co/t/end-to-end-latency-with-traces/338452 "2023-07-15T08:19:55Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![sangramreddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sangramreddy/32/122068_2.png) [@sangramreddy](https://discuss.elastic.co/u/sangramreddy)\
**Post date:** [July 16, 2023, 8:40pm UTC](https://discuss.elastic.co/t/end-to-end-latency-with-traces/338452/8 "2023-07-16T20:40:32Z")

</div>

Thank you!

I did post on this topic earlier but did not get much help.

> [@Public API using startTransactionWithRemoteParent for Kafka headers](https://discuss.elastic.co/t/public-api-using-starttransactionwithremoteparent-for-kafka-headers/336183/2):
>
> The HeaderExtractor interface is very generic, as you can see from that example it's really just any lambda that returns a string. So you can use that for anything, you just need to specify extracting the header from kafka

I had to add encode/decode methods according to the format expected from agent. This does not seem correct and could easily break. I thought there must be a better way, but didn't get any info on that from your documentation or forum.

Will take a look at the code.

---

_[View the full topic](https://discuss.elastic.co/t/end-to-end-latency-with-traces/338452)._
