[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:
parent
86b60bbc63
commit
2d8a41d367
|
@ -107,6 +107,7 @@ export const SnapshotRequestRT = rt.intersection([
|
||||||
region: rt.string,
|
region: rt.string,
|
||||||
filterQuery: rt.union([rt.string, rt.null]),
|
filterQuery: rt.union([rt.string, rt.null]),
|
||||||
includeTimeseries: rt.boolean,
|
includeTimeseries: rt.boolean,
|
||||||
|
overrideCompositeSize: rt.number,
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ describe('Metrics UI Observability Homepage Functions', () => {
|
||||||
groupBy: [],
|
groupBy: [],
|
||||||
nodeType: 'host',
|
nodeType: 'host',
|
||||||
includeTimeseries: true,
|
includeTimeseries: true,
|
||||||
|
overrideCompositeSize: 5,
|
||||||
timerange: {
|
timerange: {
|
||||||
from: startTime.valueOf(),
|
from: startTime.valueOf(),
|
||||||
to: endTime.valueOf(),
|
to: endTime.valueOf(),
|
||||||
|
|
|
@ -87,6 +87,7 @@ export const createMetricsFetchData = (
|
||||||
groupBy: [],
|
groupBy: [],
|
||||||
nodeType: 'host',
|
nodeType: 'host',
|
||||||
includeTimeseries: true,
|
includeTimeseries: true,
|
||||||
|
overrideCompositeSize: 5,
|
||||||
timerange: {
|
timerange: {
|
||||||
from: start,
|
from: start,
|
||||||
to: end,
|
to: end,
|
||||||
|
|
|
@ -86,7 +86,7 @@ const requestGroupedNodes = async (
|
||||||
aggregations: {
|
aggregations: {
|
||||||
nodes: {
|
nodes: {
|
||||||
composite: {
|
composite: {
|
||||||
size: SNAPSHOT_COMPOSITE_REQUEST_SIZE,
|
size: options.overrideCompositeSize || SNAPSHOT_COMPOSITE_REQUEST_SIZE,
|
||||||
sources: getGroupedNodesSources(options),
|
sources: getGroupedNodesSources(options),
|
||||||
},
|
},
|
||||||
aggs: {
|
aggs: {
|
||||||
|
@ -142,7 +142,7 @@ const requestNodeMetrics = async (
|
||||||
aggregations: {
|
aggregations: {
|
||||||
nodes: {
|
nodes: {
|
||||||
composite: {
|
composite: {
|
||||||
size: SNAPSHOT_COMPOSITE_REQUEST_SIZE,
|
size: options.overrideCompositeSize || SNAPSHOT_COMPOSITE_REQUEST_SIZE,
|
||||||
sources: getMetricsSources(options),
|
sources: getMetricsSources(options),
|
||||||
},
|
},
|
||||||
aggregations: {
|
aggregations: {
|
||||||
|
|
|
@ -40,6 +40,7 @@ export const initSnapshotRoute = (libs: InfraBackendLibs) => {
|
||||||
accountId,
|
accountId,
|
||||||
region,
|
region,
|
||||||
includeTimeseries,
|
includeTimeseries,
|
||||||
|
overrideCompositeSize,
|
||||||
} = pipe(
|
} = pipe(
|
||||||
SnapshotRequestRT.decode(request.body),
|
SnapshotRequestRT.decode(request.body),
|
||||||
fold(throwErrors(Boom.badRequest), identity)
|
fold(throwErrors(Boom.badRequest), identity)
|
||||||
|
@ -59,6 +60,7 @@ export const initSnapshotRoute = (libs: InfraBackendLibs) => {
|
||||||
metrics,
|
metrics,
|
||||||
timerange,
|
timerange,
|
||||||
includeTimeseries,
|
includeTimeseries,
|
||||||
|
overrideCompositeSize,
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchES = <Hit = {}, Aggregation = undefined>(
|
const searchES = <Hit = {}, Aggregation = undefined>(
|
||||||
|
|
Loading…
Reference in a new issue