# Question about the statistics of Transaction Latency

**URL:** <https://discuss.elastic.co/t/question-about-the-statistics-of-transaction-latency/296941>\
**Category:** APM\
**Tags:** java\
**Created:** [February 11, 2022, 6:59am UTC](https://discuss.elastic.co/t/question-about-the-statistics-of-transaction-latency/296941 "2022-02-11T06:59:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wo7387196](https://avatars.discourse-cdn.com/v4/letter/w/94ad74/32.png) [@wo7387196](https://discuss.elastic.co/u/wo7387196)\
**Post date:** [February 11, 2022, 6:59am UTC](https://discuss.elastic.co/t/question-about-the-statistics-of-transaction-latency/296941/1 "2022-02-11T06:59:10Z")

</div>

![QQ截图20220211110312](https://us1.discourse-cdn.com/elastic/original/3X/7/3/7334fab37d8dc5a74a52840e774583d69aaca87a.png)  
why the Latency is the 50+ us , but not the third span end time 164us,  
I'm more concerned about the longest Latency 。

---

<div class="post-metadata">

**Author:** ![Spank321](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spank321/32/101769_2.png) [@Spank321](https://discuss.elastic.co/u/Spank321)\
**Post date:** [February 11, 2022, 8:49pm UTC](https://discuss.elastic.co/t/question-about-the-statistics-of-transaction-latency/296941/2 "2022-02-11T20:49:06Z")

</div>

Hi!  
I had this problem when server sent custom span-logs to APM server without @timestamp attribute (in this case APM Server insert @timestamp to logs when APM Server already accepted the logs).

But I think that the real reason for this problem is the parent-transaction side has different server time then the child-transaction side

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [February 13, 2022, 8:13am UTC](https://discuss.elastic.co/t/question-about-the-statistics-of-transaction-latency/296941/3 "2022-02-13T08:13:39Z")

</div>

This seems related to asynchronous execution - the `MarketData` transaction handles a request by creating a `MarketEvent` and dispatching it to an asynchronous handling by some other thread pool and then returns. We consider the duration of the request handling from the perspective of the caller/client, which is the transaction duration (time to respond to caller).  
If this properly reflects your application, then I think you shouldn't mess with it, regardless if these are custom spans, like @Spank321 suggests, or automatically captured ones.

What you can do is create your own "Full Market Event handling duration" dashboard based on the raw data- you can look for all spans with a given `transaction.id` and consider then greatest `timestamp.us + span.duration.us` as the end timestamp of event handling.

I hope this helps...

---

<div class="post-metadata">

**Author:** ![wo7387196](https://avatars.discourse-cdn.com/v4/letter/w/94ad74/32.png) [@wo7387196](https://discuss.elastic.co/u/wo7387196)\
**Post date:** [February 14, 2022, 5:58am UTC](https://discuss.elastic.co/t/question-about-the-statistics-of-transaction-latency/296941/4 "2022-02-14T05:58:49Z")

</div>

> [@Eyal\_Koren](#):
>
> asynchronous

Thank you for advice. i trid to create the "Full Market Event handling duration" dashboard ,but faild.How to visualize `timestamp.us +span.duration.us` ?  
I am new to kibana,can you share me a guide to creat the dashboard to show distribution of latency of "Full Market Event handling duration" ?  
Thanks again

---

<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:** [March 7, 2022, 1:58am UTC](https://discuss.elastic.co/t/question-about-the-statistics-of-transaction-latency/296941/5 "2022-03-07T01:58:57Z")

</div>

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