[Metrics UI] Optimizations for Inventory Threshold Alerts (#122460)

* [Metrics UI] Optimizations for Inventory Threshold Alerts

* reverting changes to the snapshot api
This commit is contained in:
Chris Cowan 2022-01-24 16:35:22 -07:00 committed by GitHub
parent f2e2add9ae
commit d55fd9bb11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 3 deletions

View file

@ -23,5 +23,8 @@ Field used to identify Docker containers. Defaults to `container.id`.
`xpack.infra.sources.default.fields.pod`::
Field used to identify Kubernetes pods. Defaults to `kubernetes.pod.uid`.
`xpack.infra.alerting.inventory_threshold.group_by_page_size`::
Controls the size of the composite aggregations used by the Inventory Threshold to retrieve all the hosts. Defaults to `10_000`.
`xpack.infra.alerting.metric_threshold.group_by_page_size`::
Controls the size of the composite aggregations used by the Metric Threshold group by feature. Defaults to `10000`.
Controls the size of the composite aggregations used by the Metric Threshold group by feature. Defaults to `10_000`.

View file

@ -110,7 +110,7 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) =
)
.catch(() => undefined);
const compositeSize = libs.configuration.inventory.compositeSize;
const compositeSize = libs.configuration.alerting.inventory_threshold.group_by_page_size;
const results = await Promise.all(
criteria.map((condition) =>
evaluateCondition({

View file

@ -749,6 +749,9 @@ describe('The metric threshold alert type', () => {
const createMockStaticConfiguration = (sources: any) => ({
alerting: {
inventory_threshold: {
group_by_page_size: 100,
},
metric_threshold: {
group_by_page_size: 100,
},

View file

@ -110,6 +110,9 @@ describe('the InfraSources lib', () => {
const createMockStaticConfiguration = (sources: any) => ({
alerting: {
inventory_threshold: {
group_by_page_size: 10000,
},
metric_threshold: {
group_by_page_size: 10000,
},

View file

@ -45,8 +45,11 @@ import { configDeprecations, getInfraDeprecationsFactory } from './deprecations'
export const config: PluginConfigDescriptor<InfraConfig> = {
schema: schema.object({
alerting: schema.object({
inventory_threshold: schema.object({
group_by_page_size: schema.number({ defaultValue: 10_000 }),
}),
metric_threshold: schema.object({
group_by_page_size: schema.number({ defaultValue: 10000 }),
group_by_page_size: schema.number({ defaultValue: 10_000 }),
}),
}),
inventory: schema.object({

View file

@ -34,6 +34,9 @@ export interface InfraPluginRequestHandlerContext extends RequestHandlerContext
export interface InfraConfig {
alerting: {
inventory_threshold: {
group_by_page_size: number;
};
metric_threshold: {
group_by_page_size: number;
};