Skip to content

Commit

Permalink
update has_rum_data query to account for undefined start and end
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiqueclarke committed May 14, 2021
1 parent 0d334c8 commit 9eed989
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion x-pack/plugins/apm/server/lib/rum_client/has_rum_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,18 @@ export async function hasRumData({
},
aggs: {
services: {
...(start && end ? { filter: rangeQuery(start, end)[0] } : {}),
...(start && end
? { filter: rangeQuery(start, end)[0] }
: {
// accounts for scenarios in which start and end are undefined
filter: {
range: {
'@timestamp': {
format: 'epoch_millis',
},
},
},
}),
aggs: {
mostTraffic: {
terms: {
Expand Down

0 comments on commit 9eed989

Please sign in to comment.