[Metrics UI] Make composite size configurable to avoid max buckets (#72955)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Chris Cowan 2020-07-28 12:39:36 -07:00 committed by GitHub
parent 86b60bbc63
commit 2d8a41d367
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 2 deletions

View file

@ -107,6 +107,7 @@ export const SnapshotRequestRT = rt.intersection([
region: rt.string,
filterQuery: rt.union([rt.string, rt.null]),
includeTimeseries: rt.boolean,
overrideCompositeSize: rt.number,
}),
]);

View file

@ -75,6 +75,7 @@ describe('Metrics UI Observability Homepage Functions', () => {
groupBy: [],
nodeType: 'host',
includeTimeseries: true,
overrideCompositeSize: 5,
timerange: {
from: startTime.valueOf(),
to: endTime.valueOf(),

View file

@ -87,6 +87,7 @@ export const createMetricsFetchData = (
groupBy: [],
nodeType: 'host',
includeTimeseries: true,
overrideCompositeSize: 5,
timerange: {
from: start,
to: end,

View file

@ -86,7 +86,7 @@ const requestGroupedNodes = async (
aggregations: {
nodes: {
composite: {
size: SNAPSHOT_COMPOSITE_REQUEST_SIZE,
size: options.overrideCompositeSize || SNAPSHOT_COMPOSITE_REQUEST_SIZE,
sources: getGroupedNodesSources(options),
},
aggs: {
@ -142,7 +142,7 @@ const requestNodeMetrics = async (
aggregations: {
nodes: {
composite: {
size: SNAPSHOT_COMPOSITE_REQUEST_SIZE,
size: options.overrideCompositeSize || SNAPSHOT_COMPOSITE_REQUEST_SIZE,
sources: getMetricsSources(options),
},
aggregations: {

View file

@ -40,6 +40,7 @@ export const initSnapshotRoute = (libs: InfraBackendLibs) => {
accountId,
region,
includeTimeseries,
overrideCompositeSize,
} = pipe(
SnapshotRequestRT.decode(request.body),
fold(throwErrors(Boom.badRequest), identity)
@ -59,6 +60,7 @@ export const initSnapshotRoute = (libs: InfraBackendLibs) => {
metrics,
timerange,
includeTimeseries,
overrideCompositeSize,
};
const searchES = <Hit = {}, Aggregation = undefined>(