Skip to content

Commit 06a910a

Browse files
[Uptime] Use date histogram in monitor states (#67558)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent 68e103e commit 06a910a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
SortOrder,
1616
} from '../../../../common/runtime_types';
1717
import { MonitorEnricher } from './fetch_page';
18+
import { getHistogramInterval } from '../../helper/get_histogram_interval';
1819

1920
export const enrichMonitorGroups: MonitorEnricher = async (
2021
queryContext: QueryContext,
@@ -317,11 +318,13 @@ const getHistogramForMonitors = async (
317318
},
318319
aggs: {
319320
histogram: {
320-
auto_date_histogram: {
321+
date_histogram: {
321322
field: '@timestamp',
322323
// 12 seems to be a good size for performance given
323324
// long monitor lists of up to 100 on the overview page
324-
buckets: 12,
325+
fixed_interval:
326+
getHistogramInterval(queryContext.dateRangeStart, queryContext.dateRangeEnd, 12) +
327+
'ms',
325328
missing: 0,
326329
},
327330
aggs: {

0 commit comments

Comments
 (0)