[Custom threshold] Remove CUSTOM_AGGREGATOR aggType from rule creation API (#171377)

Closes #159340

## Summary

Since the Custom threshold is the default aggregation type, we no longer
need to pass `aggType: CUSTOM_AGGREGATOR` to the rule creation API. I
added this as optional in the schema so the previous rules with this
field will not throw a schema validation error.

## How to test
- Everything should work as before in the custom threshold; the only
difference is that there is no need to provide aggType at the top level.
- Providing `aggType: custom` through API should be OK, and the rule
should work as expected with or without this field.
This commit is contained in:
Maryam Saeidi 2023-11-23 10:12:39 +01:00 committed by GitHub
parent 8f91b39937
commit c038eea3fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 29 additions and 183 deletions

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -39,7 +38,6 @@ export const createCustomThresholdRule = async (
params: {
criteria: ruleParams.params?.criteria || [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [1],
timeSize: 1,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -23,7 +22,6 @@ export const scenario1 = {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.LT,
threshold: [100],
timeSize: 1,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -23,7 +22,6 @@ export const scenario2 = {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.LT,
threshold: [40],
timeSize: 1,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -23,7 +22,6 @@ export const scenario3 = {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.LT,
threshold: [5],
timeSize: 1,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -23,7 +22,6 @@ export const scenario4 = {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [80],
timeSize: 1,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -23,7 +22,6 @@ export const scenario5 = {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [80],
timeSize: 5,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -23,7 +22,6 @@ export const scenario6 = {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.LT,
threshold: [1],
timeSize: 1,

View file

@ -1,17 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
export const METRIC_EXPLORER_AGGREGATIONS = [
'avg',
'max',
'min',
'cardinality',
'count',
'sum',
] as const;
export const CUSTOM_AGGREGATOR = 'custom';

View file

@ -8,7 +8,6 @@
import * as rt from 'io-ts';
import { SerializedSearchSourceFields } from '@kbn/data-plugin/common';
import { TimeUnitChar } from '../utils/formatters/duration';
import { CUSTOM_AGGREGATOR } from './constants';
export const ThresholdFormatterTypeRT = rt.keyof({
abbreviatedNumber: null,
@ -84,7 +83,6 @@ export interface CustomThresholdExpressionMetric {
}
export interface CustomMetricExpressionParams extends BaseMetricExpressionParams {
aggType: typeof CUSTOM_AGGREGATOR;
metrics: CustomThresholdExpressionMetric[];
equation?: string;
label?: string;

View file

@ -22,7 +22,6 @@ Array [
"title": "unknown-index",
},
"expression": Object {
"aggType": "custom",
"comparator": ">",
"metrics": Array [
Object {

View file

@ -134,7 +134,7 @@ export default function AlertDetailsAppSection({
<EuiFlexItem key={`criterion-${index}`}>
<EuiPanel hasBorder hasShadow={false}>
<EuiTitle size="xs">
<h4>{criterion.aggType.toUpperCase()} </h4>
<h4>{criterion.label || 'CUSTOM'} </h4>
</EuiTitle>
<EuiText size="s" color="subdued">
<FormattedMessage

View file

@ -14,7 +14,6 @@ import {
Comparator,
CustomMetricExpressionParams,
} from '../../../../../common/custom_threshold_rule/types';
import { CUSTOM_AGGREGATOR } from '../../../../../common/custom_threshold_rule/constants';
import { TimeUnitChar } from '../../../../../common';
import { CustomEquationEditor, CustomEquationEditorProps } from './custom_equation_editor';
@ -92,7 +91,6 @@ export const CustomEquationEditorWithFieldError = CustomEquationEditorTemplate.b
const BASE_ARGS: Partial<CustomEquationEditorProps> = {
expression: {
aggType: CUSTOM_AGGREGATOR,
metrics: [
{
name: 'A',
@ -120,7 +118,6 @@ CustomEquationEditorDefault.args = {
CustomEquationEditorWithEquationErrors.args = {
...BASE_ARGS,
expression: {
aggType: CUSTOM_AGGREGATOR,
equation: 'Math.round(A / B)',
metrics: [
{ name: 'A', aggType: Aggregators.AVERAGE, field: 'system.cpu.user.pct' },

View file

@ -12,7 +12,6 @@ import { DataViewBase } from '@kbn/es-query';
import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers';
import React, { ReactElement } from 'react';
import { act } from 'react-dom/test-utils';
import { CUSTOM_AGGREGATOR } from '../../../../common/custom_threshold_rule/constants';
import { Aggregators, Comparator } from '../../../../common/custom_threshold_rule/types';
import { MetricExpression } from '../types';
import { ExpressionChart } from './expression_chart';
@ -77,7 +76,6 @@ describe('ExpressionChart', () => {
it('should display no data message', async () => {
const expression: MetricExpression = {
aggType: CUSTOM_AGGREGATOR,
metrics: [
{
name: 'A',

View file

@ -9,7 +9,6 @@ import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers';
import React from 'react';
import { act } from 'react-dom/test-utils';
import { CUSTOM_AGGREGATOR } from '../../../../common/custom_threshold_rule/constants';
import { Aggregators, Comparator } from '../../../../common/custom_threshold_rule/types';
import { MetricExpression } from '../types';
import { ExpressionRow } from './expression_row';
@ -58,7 +57,6 @@ describe('ExpressionRow', () => {
it('should display thresholds as a percentage for pct metrics', async () => {
const expression: MetricExpression = {
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{
@ -84,7 +82,6 @@ describe('ExpressionRow', () => {
it('should display thresholds as a decimal for all other metrics', async () => {
const expression = {
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{

View file

@ -9,7 +9,6 @@ import React from 'react';
import { act } from 'react-dom/test-utils';
import { DataView } from '@kbn/data-views-plugin/common';
import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers';
import { CUSTOM_AGGREGATOR } from '../../../../../common/custom_threshold_rule/constants';
import { Comparator, Aggregators } from '../../../../../common/custom_threshold_rule/types';
import { useKibana } from '../../../../utils/kibana_react';
import { kibanaStartMock } from '../../../../utils/kibana_react.mock';
@ -55,7 +54,6 @@ describe('Preview chart', () => {
it('should display no data message', async () => {
const expression: MetricExpression = {
aggType: CUSTOM_AGGREGATOR,
metrics: [
{
name: 'A',

View file

@ -27,17 +27,12 @@ export function validateCustomThreshold({
const validationResult = { errors: {} };
const errors: {
[id: string]: {
aggField: string[];
timeSizeUnit: string[];
timeWindowSize: string[];
critical: {
threshold0: string[];
threshold1: string[];
};
warning: {
threshold0: string[];
threshold1: string[];
};
metricsError?: string;
metrics: Record<string, { aggType?: string; field?: string; filter?: string }>;
equation?: string;
@ -91,23 +86,9 @@ export function validateCustomThreshold({
threshold0: [],
threshold1: [],
},
warning: {
threshold0: [],
threshold1: [],
},
metric: [],
metrics: {},
};
if (!c.aggType) {
errors[id].aggField.push(
i18n.translate(
'xpack.observability.customThreshold.rule.alertFlyout.error.aggregationRequired',
{
defaultMessage: 'Aggregation is required.',
}
)
);
}
if (!c.threshold || !c.threshold.length) {
errors[id].critical.threshold0.push(
@ -120,8 +101,30 @@ export function validateCustomThreshold({
);
}
if (c.warningThreshold && !c.warningThreshold.length) {
errors[id].warning.threshold0.push(
// The Threshold component returns an empty array with a length ([empty]) because it's using delete newThreshold[i].
// We need to use [...c.threshold] to convert it to an array with an undefined value ([undefined]) so we can test each element.
const { comparator, threshold } = { comparator: c.comparator, threshold: c.threshold } as {
comparator?: Comparator;
threshold?: number[];
};
if (threshold && threshold.length && ![...threshold].every(isNumber)) {
[...threshold].forEach((v, i) => {
if (!isNumber(v)) {
const key = i === 0 ? 'threshold0' : 'threshold1';
errors[id].critical[key].push(
i18n.translate(
'xpack.observability.customThreshold.rule.alertFlyout.error.thresholdTypeRequired',
{
defaultMessage: 'Thresholds must contain a valid number.',
}
)
);
}
});
}
if (comparator === Comparator.BETWEEN && (!threshold || threshold.length < 2)) {
errors[id].critical.threshold1.push(
i18n.translate(
'xpack.observability.customThreshold.rule.alertFlyout.error.thresholdRequired',
{
@ -131,45 +134,6 @@ export function validateCustomThreshold({
);
}
for (const props of [
{ comparator: c.comparator, threshold: c.threshold, type: 'critical' },
{ comparator: c.warningComparator, threshold: c.warningThreshold, type: 'warning' },
]) {
// The Threshold component returns an empty array with a length ([empty]) because it's using delete newThreshold[i].
// We need to use [...c.threshold] to convert it to an array with an undefined value ([undefined]) so we can test each element.
const { comparator, threshold, type } = props as {
comparator?: Comparator;
threshold?: number[];
type: 'critical' | 'warning';
};
if (threshold && threshold.length && ![...threshold].every(isNumber)) {
[...threshold].forEach((v, i) => {
if (!isNumber(v)) {
const key = i === 0 ? 'threshold0' : 'threshold1';
errors[id][type][key].push(
i18n.translate(
'xpack.observability.customThreshold.rule.alertFlyout.error.thresholdTypeRequired',
{
defaultMessage: 'Thresholds must contain a valid number.',
}
)
);
}
});
}
if (comparator === Comparator.BETWEEN && (!threshold || threshold.length < 2)) {
errors[id][type].threshold1.push(
i18n.translate(
'xpack.observability.customThreshold.rule.alertFlyout.error.thresholdRequired',
{
defaultMessage: 'Threshold is required.',
}
)
);
}
}
if (!c.timeSize) {
errors[id].timeWindowSize.push(
i18n.translate('xpack.observability.customThreshold.rule.alertFlyout.error.timeRequred', {

View file

@ -95,7 +95,6 @@ describe('Expression', () => {
threshold: [1000],
timeSize: 1,
timeUnit: 'm',
aggType: 'custom',
},
]);
});

View file

@ -37,7 +37,6 @@ import {
} from '@kbn/triggers-actions-ui-plugin/public';
import { useKibana } from '../../utils/kibana_react';
import { CUSTOM_AGGREGATOR } from '../../../common/custom_threshold_rule/constants';
import { Aggregators, Comparator } from '../../../common/custom_threshold_rule/types';
import { TimeUnitChar } from '../../../common/utils/formatters/duration';
import { AlertContextMeta, AlertParams, MetricExpression } from './types';
@ -53,7 +52,6 @@ type Props = Omit<
>;
export const defaultExpression: MetricExpression = {
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{

View file

@ -52,11 +52,10 @@ export const useExpressionChartData = (
equation: expression.equation,
},
],
aggregation: expression.aggType || 'custom',
aggregation: 'custom',
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[
expression.aggType,
expression.equation,
// eslint-disable-next-line react-hooks/exhaustive-deps
JSON.stringify(expression.metrics),

View file

@ -6,7 +6,6 @@
*/
import { v4 as uuidv4 } from 'uuid';
import { CUSTOM_AGGREGATOR } from '../../../../common/custom_threshold_rule/constants';
import { Aggregators, Comparator } from '../../../../common/custom_threshold_rule/types';
import { CustomThresholdAlert, CustomThresholdRule } from '../components/alert_details_app_section';
@ -60,7 +59,6 @@ export const buildCustomThresholdRule = (
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{
@ -73,7 +71,6 @@ export const buildCustomThresholdRule = (
timeUnit: 'm',
},
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{
@ -89,7 +86,6 @@ export const buildCustomThresholdRule = (
warningThreshold: [2.2],
},
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{
@ -155,7 +151,6 @@ export const buildCustomThresholdAlert = (
'kibana.alert.rule.parameters': {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{
@ -169,7 +164,6 @@ export const buildCustomThresholdAlert = (
timeUnit: 'm',
},
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{

View file

@ -74,8 +74,6 @@ export interface InfraClientStartDeps {
uiActions: UiActionsStart;
unifiedSearch: UnifiedSearchPublicPluginStart;
usageCollection: UsageCollectionStart;
// TODO:: check if needed => https://github.com/elastic/kibana/issues/159340
// telemetry: ITelemetryClient;
}
export type RendererResult = React.ReactElement<any> | null;

View file

@ -21,7 +21,6 @@ import { CustomThresholdAlertContext } from './types';
import { Evaluation } from './lib/evaluate_rule';
import type { LogMeta, Logger } from '@kbn/logging';
import { DEFAULT_FLAPPING_SETTINGS } from '@kbn/alerting-plugin/common';
import { CUSTOM_AGGREGATOR } from '../../../../common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -1883,7 +1882,6 @@ declare global {
}
const customThresholdNonCountCriterion: CustomMetricExpressionParams = {
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{
@ -1898,7 +1896,6 @@ const customThresholdNonCountCriterion: CustomMetricExpressionParams = {
};
const customThresholdCountCriterion: CustomMetricExpressionParams = {
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
metrics: [
{

View file

@ -6,7 +6,6 @@
*/
import moment from 'moment';
import { CUSTOM_AGGREGATOR } from '../../../../../common/custom_threshold_rule/constants';
import {
Comparator,
Aggregators,
@ -23,7 +22,6 @@ describe("The Metric Threshold Alert's getElasticsearchMetricQuery", () => {
field: 'system.is.a.good.puppy.dog',
},
],
aggType: CUSTOM_AGGREGATOR,
timeUnit: 'm',
timeSize: 1,
threshold: [1],

View file

@ -43,7 +43,6 @@ import { oneOfLiterals, validateKQLStringFilter } from './utils';
import { createCustomThresholdExecutor } from './custom_threshold_executor';
import { FIRED_ACTION, NO_DATA_ACTION } from './constants';
import { ObservabilityConfig } from '../../..';
import { METRIC_EXPLORER_AGGREGATIONS } from '../../../../common/custom_threshold_rule/constants';
export const MetricsRulesTypeAlertDefinition: IRuleTypeAlerts = {
context: THRESHOLD_RULE_REGISTRATION_CONTEXT,
@ -79,27 +78,9 @@ export function thresholdRuleType(
timeSize: schema.number(),
};
const nonCountCriterion = schema.object({
...baseCriterion,
metric: schema.string(),
aggType: oneOfLiterals(METRIC_EXPLORER_AGGREGATIONS),
metrics: schema.never(),
equation: schema.never(),
label: schema.never(),
});
const countCriterion = schema.object({
...baseCriterion,
aggType: schema.literal('count'),
metric: schema.never(),
metrics: schema.never(),
equation: schema.never(),
label: schema.never(),
});
const customCriterion = schema.object({
...baseCriterion,
aggType: schema.literal('custom'),
aggType: schema.maybe(schema.literal('custom')),
metric: schema.never(),
metrics: schema.arrayOf(
schema.oneOf([
@ -133,9 +114,7 @@ export function thresholdRuleType(
validate: {
params: schema.object(
{
criteria: schema.arrayOf(
schema.oneOf([countCriterion, nonCountCriterion, customCriterion])
),
criteria: schema.arrayOf(customCriterion),
groupBy: schema.maybe(schema.oneOf([schema.string(), schema.arrayOf(schema.string())])),
alertOnNoData: schema.maybe(schema.boolean()),
alertOnGroupDisappear: schema.maybe(schema.boolean()),

View file

@ -29219,7 +29219,6 @@
"xpack.observability.customThreshold.rule.alertFlyout.customEquationTooltip": "Ceci est compatible avec des calculs de base (A + B / C) et la logique booléenne (A < B ? A : B).",
"xpack.observability.customThreshold.rule.alertFlyout.dataViewError.noTimestamp": "La vue de données sélectionnée ne dispose pas de champ d'horodatage. Veuillez sélectionner une autre vue de données.",
"xpack.observability.customThreshold.rule.alertFlyout.defineTextQueryPrompt": "Définir le filtre de recherche (facultatif)",
"xpack.observability.customThreshold.rule.alertFlyout.error.aggregationRequired": "L'agrégation est requise.",
"xpack.observability.customThreshold.rule.alertFlyout.error.equation.invalidCharacters": "Le champ d'équation prend en charge uniquement les caractères suivants : A-Z, +, -, /, *, (, ), ?, !, &, :, |, >, <, =",
"xpack.observability.customThreshold.rule.alertFlyout.error.invalidFilterQuery": "La requête de filtre n'est pas valide.",
"xpack.observability.customThreshold.rule.alertFlyout.error.invalidSearchConfiguration": "La vue de données est requise.",

View file

@ -29218,7 +29218,6 @@
"xpack.observability.customThreshold.rule.alertFlyout.customEquationTooltip": "これは基本的な数学ロジックA + B / CとブールロジックA < B ?A :Bをサポートします。",
"xpack.observability.customThreshold.rule.alertFlyout.dataViewError.noTimestamp": "選択したデータビューにタイムスタンプフィールドがありません。他のデータビューを選択してください。",
"xpack.observability.customThreshold.rule.alertFlyout.defineTextQueryPrompt": "クエリフィルターを定義(任意)",
"xpack.observability.customThreshold.rule.alertFlyout.error.aggregationRequired": "集約が必要です。",
"xpack.observability.customThreshold.rule.alertFlyout.error.equation.invalidCharacters": "等式フィールドでは次の文字のみを使用できますA-Z、+、-、/、*、(、)、?、!、&、:、|、>、<、=",
"xpack.observability.customThreshold.rule.alertFlyout.error.invalidFilterQuery": "フィルタークエリは無効です。",
"xpack.observability.customThreshold.rule.alertFlyout.error.invalidSearchConfiguration": "データビューが必要です。",

View file

@ -29216,7 +29216,6 @@
"xpack.observability.customThreshold.rule.alertFlyout.customEquationTooltip": "这支持基本数学 (A + B / C) 和布尔逻辑 (A < B ?A :B)。",
"xpack.observability.customThreshold.rule.alertFlyout.dataViewError.noTimestamp": "选定数据视图没有时间戳字段,请选择其他数据视图。",
"xpack.observability.customThreshold.rule.alertFlyout.defineTextQueryPrompt": "定义查询筛选(可选)",
"xpack.observability.customThreshold.rule.alertFlyout.error.aggregationRequired": "“聚合”必填。",
"xpack.observability.customThreshold.rule.alertFlyout.error.equation.invalidCharacters": "方程字段仅支持以下字符A-Z、+、-、/、*、(、)、?、!、&、:、|、>、<、=",
"xpack.observability.customThreshold.rule.alertFlyout.error.invalidFilterQuery": "筛选查询无效。",
"xpack.observability.customThreshold.rule.alertFlyout.error.invalidSearchConfiguration": "需要数据视图。",

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import moment from 'moment';
import { cleanup, generate } from '@kbn/infra-forge';
import {
@ -92,7 +91,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [0.5],
timeSize: 5,
@ -189,7 +187,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: 'custom',
comparator: '>',
threshold: [0.5],
timeSize: 5,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import moment from 'moment';
import {
Aggregators,
@ -85,7 +84,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [0.5],
timeSize: 5,
@ -181,7 +179,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: 'custom',
comparator: '>',
threshold: [0.5],
timeSize: 5,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import moment from 'moment';
import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace';
import { format } from 'url';
@ -98,7 +97,7 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
aggType: 'custom',
comparator: Comparator.GT,
threshold: [7500000],
timeSize: 5,

View file

@ -11,7 +11,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import moment from 'moment';
import { cleanup, generate } from '@kbn/infra-forge';
import {
@ -97,7 +96,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [0.9],
timeSize: 1,
@ -195,7 +193,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [0.9],
timeSize: 1,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import moment from 'moment';
import { cleanup, generate } from '@kbn/infra-forge';
import {
@ -92,7 +91,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [2],
timeSize: 1,
@ -188,7 +186,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: 'custom',
comparator: '>',
threshold: [2],
timeSize: 1,

View file

@ -7,7 +7,6 @@
import moment from 'moment';
import { cleanup, generate } from '@kbn/infra-forge';
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -91,7 +90,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT_OR_EQ,
threshold: [0.2],
timeSize: 1,
@ -214,7 +212,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: 'custom',
comparator: '>=',
threshold: [0.2],
timeSize: 1,

View file

@ -6,7 +6,6 @@
*/
import expect from '@kbn/expect';
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -74,7 +73,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [7500000],
timeSize: 5,

View file

@ -6,7 +6,6 @@
*/
import { cleanup, generate } from '@kbn/infra-forge';
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -89,7 +88,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [0.5],
timeSize: 5,
@ -184,7 +182,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: 'custom',
comparator: '>',
threshold: [0.5],
timeSize: 5,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -75,7 +74,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [0.5],
timeSize: 5,
@ -170,7 +168,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: 'custom',
comparator: '>',
threshold: [0.5],
timeSize: 5,

View file

@ -12,7 +12,6 @@
*/
import { cleanup, generate } from '@kbn/infra-forge';
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -91,7 +90,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [0.9],
timeSize: 1,
@ -188,7 +186,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [0.9],
timeSize: 1,

View file

@ -6,7 +6,6 @@
*/
import { cleanup, generate } from '@kbn/infra-forge';
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import {
Aggregators,
Comparator,
@ -85,7 +84,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT,
threshold: [2],
timeSize: 1,
@ -178,7 +176,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: 'custom',
comparator: '>',
threshold: [2],
timeSize: 1,

View file

@ -11,7 +11,6 @@
* 2.0.
*/
import { CUSTOM_AGGREGATOR } from '@kbn/observability-plugin/common/custom_threshold_rule/constants';
import { kbnTestConfig } from '@kbn/test';
import moment from 'moment';
import { cleanup, generate } from '@kbn/infra-forge';
@ -95,7 +94,6 @@ export default function ({ getService }: FtrProviderContext) {
params: {
criteria: [
{
aggType: CUSTOM_AGGREGATOR,
comparator: Comparator.GT_OR_EQ,
threshold: [0.2],
timeSize: 1,
@ -205,7 +203,6 @@ export default function ({ getService }: FtrProviderContext) {
.eql({
criteria: [
{
aggType: 'custom',
comparator: '>=',
threshold: [0.2],
timeSize: 1,