diff --git a/x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts b/x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts index 8de2e4e1cca42..87136fc0538a6 100644 --- a/x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts +++ b/x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts @@ -14,7 +14,11 @@ import { ProcessorEvent } from '../../../common/processor_event'; import { rangeQuery } from '../../../server/utils/queries'; import { TRANSACTION_PAGE_LOAD } from '../../../common/transaction_types'; -export async function hasRumData({ setup }: { setup: Setup & SetupTimeRange }) { +export async function hasRumData({ + setup, +}: { + setup: Setup & Partial; +}) { try { const { start, end } = setup; diff --git a/x-pack/plugins/apm/server/routes/rum_client.ts b/x-pack/plugins/apm/server/routes/rum_client.ts index c723f2c266ca9..bf58c7fcf39b2 100644 --- a/x-pack/plugins/apm/server/routes/rum_client.ts +++ b/x-pack/plugins/apm/server/routes/rum_client.ts @@ -7,6 +7,7 @@ import * as t from 'io-ts'; import { jsonRt } from '@kbn/io-ts-utils'; +import { isoToEpochRt } from '@kbn/io-ts-utils'; import { LocalUIFilterName } from '../../common/ui_filter'; import { Setup, @@ -264,7 +265,11 @@ const rumJSErrors = createApmServerRoute({ const rumHasDataRoute = createApmServerRoute({ endpoint: 'GET /api/apm/observability_overview/has_rum_data', params: t.partial({ - query: t.intersection([uiFiltersRt, rangeRt]), + query: t.partial({ + uiFilters: t.string, + start: isoToEpochRt, + end: isoToEpochRt, + }), }), options: { tags: ['access:apm'] }, handler: async (resources) => { diff --git a/x-pack/plugins/observability/server/utils/queries.ts b/x-pack/plugins/observability/server/utils/queries.ts index 584719532ddee..9e1c110e77587 100644 --- a/x-pack/plugins/observability/server/utils/queries.ts +++ b/x-pack/plugins/observability/server/utils/queries.ts @@ -8,7 +8,7 @@ import { QueryContainer } from '@elastic/elasticsearch/api/types'; import { esKuery } from '../../../../../src/plugins/data/server'; -export function rangeQuery(start: number, end: number, field = '@timestamp'): QueryContainer[] { +export function rangeQuery(start?: number, end?: number, field = '@timestamp'): QueryContainer[] { return [ { range: {