Skip to content

Commit

Permalink
update hasRumData setup type
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiqueclarke committed May 12, 2021
1 parent 1ac495a commit 0d334c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<SetupTimeRange>;
}) {
try {
const { start, end } = setup;

Expand All @@ -31,7 +35,7 @@ export async function hasRumData({ setup }: { setup: Setup & SetupTimeRange }) {
},
aggs: {
services: {
filter: rangeQuery(start, end)[0],
...(start && end ? { filter: rangeQuery(start, end)[0] } : {}),
aggs: {
mostTraffic: {
terms: {
Expand Down

0 comments on commit 0d334c8

Please sign in to comment.