From 3959af2a305bae1e17380594ddd39919fdfc4696 Mon Sep 17 00:00:00 2001 From: Katerina Date: Mon, 17 Jun 2024 17:06:01 +0300 Subject: [PATCH] [APM] Add default time field: `@timestamp` for the ad hoc data view (#186167) ## Summary unblocks https://github.com/elastic/kibana/pull/182107 --- .../apm/public/hooks/use_adhoc_apm_data_view.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/apm/public/hooks/use_adhoc_apm_data_view.ts b/x-pack/plugins/observability_solution/apm/public/hooks/use_adhoc_apm_data_view.ts index 68074b80ce206c..918a701ea169f0 100644 --- a/x-pack/plugins/observability_solution/apm/public/hooks/use_adhoc_apm_data_view.ts +++ b/x-pack/plugins/observability_solution/apm/public/hooks/use_adhoc_apm_data_view.ts @@ -29,7 +29,11 @@ export function useAdHocApmDataView() { try { const displayError = false; - return await services.dataViews.create({ title: indexPattern }, undefined, displayError); + return await services.dataViews.create( + { title: indexPattern, timeFieldName: '@timestamp' }, + undefined, + displayError + ); } catch (e) { const noDataScreen = e.message.includes('No matching indices found'); if (noDataScreen) {