[AO] Set the Custom Threshold ONLY available on stateful as Tech Preview (#167782)

## Summary
It fixes https://github.com/elastic/kibana/issues/167650
This commit is contained in:
Faisal Kanout 2023-10-02 20:34:16 +03:00 committed by GitHub
parent ea33696ba7
commit d28227ca6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 19 additions and 16 deletions

View file

@ -298,7 +298,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
'xpack.observability.unsafe.alertDetails.logs.enabled (boolean)',
'xpack.observability.unsafe.alertDetails.uptime.enabled (boolean)',
'xpack.observability.unsafe.alertDetails.observability.enabled (boolean)',
'xpack.observability.unsafe.thresholdRule.enabled (boolean)',
'xpack.observability.unsafe.thresholdRule.enabled (any)', // conditional, is actually a boolean
'xpack.observability_onboarding.ui.enabled (boolean)',
'xpack.observabilityLogExplorer.navigation.showAppLink (any)', // conditional, is actually a boolean
];

View file

@ -159,7 +159,7 @@ export const buildMetricThresholdAlert = (
alertOnGroupDisappear: true,
},
'kibana.alert.evaluation.values': [2500, 5],
'kibana.alert.rule.category': 'Custom threshold (BETA)',
'kibana.alert.rule.category': 'Custom threshold (Technical Preview)',
'kibana.alert.rule.consumer': 'alerts',
'kibana.alert.rule.execution.uuid': '62dd07ef-ead9-4b1f-a415-7c83d03925f7',
'kibana.alert.rule.name': 'One condition',

View file

@ -8,7 +8,7 @@
// TODO: https://github.com/elastic/kibana/issues/110905
/* eslint-disable @kbn/eslint/no_export_all */
import { schema, TypeOf } from '@kbn/config-schema';
import { offeringBasedSchema, schema, TypeOf } from '@kbn/config-schema';
import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server';
import { ObservabilityPlugin, ObservabilityPluginSetup } from './plugin';
import { createOrUpdateIndex, Mappings } from './utils/create_or_update_index';
@ -47,7 +47,10 @@ const configSchema = schema.object({
}),
}),
thresholdRule: schema.object({
enabled: schema.boolean({ defaultValue: true }),
enabled: offeringBasedSchema({
serverless: schema.boolean({ defaultValue: false }),
traditional: schema.boolean({ defaultValue: true }),
}),
}),
}),
customThresholdRule: schema.object({

View file

@ -121,7 +121,7 @@ export function thresholdRuleType(
return {
id: OBSERVABILITY_THRESHOLD_RULE_TYPE_ID,
name: i18n.translate('xpack.observability.threshold.ruleName', {
defaultMessage: 'Custom threshold (BETA)',
defaultMessage: 'Custom threshold (Technical Preview)',
}),
validate: {
params: schema.object(

View file

@ -143,7 +143,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'logs');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -134,7 +134,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'logs');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -160,7 +160,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'logs');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -151,7 +151,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'logs');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -141,7 +141,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'logs');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -164,7 +164,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'logs');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -145,7 +145,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'apm');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -131,7 +131,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'apm');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -149,7 +149,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'apm');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -139,7 +139,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'apm');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');

View file

@ -158,7 +158,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.hits.hits[0]._source).property(
'kibana.alert.rule.category',
'Custom threshold (BETA)'
'Custom threshold (Technical Preview)'
);
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', 'apm');
expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule');