From 4674f3c2e921af23d98aad7c0a974f2e31d431ee Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Mon, 27 Sep 2021 17:28:11 +0200 Subject: [PATCH] [APM] Use oldest exit span instead of newest For discovering connections, select the oldest span instead of the newest. This increases the possiblity of the relevant transaction being indexed into Elasticsearch at query time. --- .../lib/connections/get_connection_stats/get_destination_map.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts index a1f74441629d4..be6518708eddb 100644 --- a/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts +++ b/x-pack/plugins/apm/server/lib/connections/get_connection_stats/get_destination_map.ts @@ -111,7 +111,7 @@ export const getDestinationMap = ({ ] as const), sort: [ { - '@timestamp': 'desc' as const, + '@timestamp': 'asc' as const, }, ], },