# Timing "drift" in timeline for REST calls between different servers

**URL:** <https://discuss.elastic.co/t/timing-drift-in-timeline-for-rest-calls-between-different-servers/294966>\
**Category:** APM\
**Tags:** java\
**Created:** [January 20, 2022, 3:42pm UTC](https://discuss.elastic.co/t/timing-drift-in-timeline-for-rest-calls-between-different-servers/294966 "2022-01-20T15:42:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias\_W](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthias_w/32/96451_2.png) [@Matthias\_W](https://discuss.elastic.co/u/Matthias_W)\
**Post date:** [January 20, 2022, 3:42pm UTC](https://discuss.elastic.co/t/timing-drift-in-timeline-for-rest-calls-between-different-servers/294966/1 "2022-01-20T15:42:14Z")

</div>

I have a C++-client (Windows) which interacts with a Java-server (Unix) using REST. Both run on different machines. For the C++-part, I have written a simple implementation to send transactions and spans directly to the APM-Server.

The C++ application uses the [GetSystemTimePreciseAsFileTime](https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime)-Windows-API to get precise clock information.

The result, however, is that the bars in the timeline view are shifted by about 20-50ms. I suppose this might be due to clock drift between the machines and/or implementation details between the JVM under Unix and the GetSystemTimePreciseAsFileTime API under Windows:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/d/ada22474e09efd459790666aaaf55f5cb2ca0fa3.png)

(Green is the C++-Client and blue is the Java-Service)

Is there any way to solve this?  
Maybe some HTTP-Header I can set which the ElasticAPM-agent in Java could use for clock synchronisation?

---

<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:** [January 26, 2022, 10:05am UTC](https://discuss.elastic.co/t/timing-drift-in-timeline-for-rest-calls-between-different-servers/294966/2 "2022-01-26T10:05:50Z")

</div>

> [@Matthias\_W](#):
>
> Is there any way to solve this?

I think your best option is to sync the time of your servers using NTP.

---

<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:** [February 16, 2022, 6:06am UTC](https://discuss.elastic.co/t/timing-drift-in-timeline-for-rest-calls-between-different-servers/294966/3 "2022-02-16T06:06:30Z")

</div>

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