Incorrect sync time in apm

hello i am using the library:
apm-agent-attach-1.7.0
apm-agent-api-1.17.0
but the final transitional but transitional is registering it to the right it seems in the last transaction it is registering it the correct start time the code I am using is:

Map<String, String> map = new HashMap<String, String>();
map.put("service_name", "apidb-ace-query");
map.put("application_packages", "ib.bus");
map.put("server_urls", System.getenv("SERVER_URL_APM"));

Transaction transaction = ElasticApm.startTransactionWithRemoteParent(key->Elastic);

try (final Scope scope = transaction.activate()) {

} catch (Exception e) {
transaction.captureException(e);
throw e;
} finally {
transaction.end();
}

I am not using spring which service is implemented in ibm ace and I am using pure java and possible to be the same time the 2 service that was invoked was sent?

Timestamp timestamp = new Timestamp(System.currentTimeMillis());
transaction.setStartTimestamp(timestamp.getTime());

I have used but it does not register correctly

incorrect

correct

Thanks for the question, but you will need to do a better job of explaining what you are doing and what's not working in order for us to be able to assist :slight_smile:

To begin with - why are you setting start timestamp manually this way? Why not rely on the timestamps that the agent will set? The setStartTimestamp is for very specific scenarios where the transaction is created at some time and started at another. If possible, try removing this usage and see if you get what you are looking for.

If this is not possible or not fixing the issue, please provide some more info:
How many services are you instrumenting?
How many services are involved in this trace?
To which service does each of the shown transactions/spans belong?

Providing the entire code that uses the agent API in each service may assist as well.