Renames "Built-In Alerts" feature to "Stack Alerts" and "Actions" feature to "Actions and Connectors" (#79513)

Renames "Built-In Alerts" feature to "Stack Alerts" and "Actions" feature to "Actions and Connectors" as we've decided these names make more appropriate and better communicate what these features are.
This commit is contained in:
Gidi Meir Morris 2020-10-06 17:51:05 +01:00 committed by GitHub
parent edbf6b8ce9
commit 25c5daa83a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 154 additions and 169 deletions

View file

@ -1046,9 +1046,7 @@ module.exports = {
*/
{
// typescript only for front and back end
files: [
'x-pack/plugins/{alerts,alerting_builtins,actions,task_manager,event_log}/**/*.{ts,tsx}',
],
files: ['x-pack/plugins/{alerts,stack_alerts,actions,task_manager,event_log}/**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
},

2
.github/CODEOWNERS vendored
View file

@ -317,7 +317,7 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
#CC# /x-pack/legacy/plugins/alerting/ @elastic/kibana-alerting-services
#CC# /x-pack/legacy/plugins/task_manager @elastic/kibana-alerting-services
#CC# /x-pack/legacy/plugins/triggers_actions_ui/ @elastic/kibana-alerting-services
#CC# /x-pack/plugins/alerting_builtins @elastic/kibana-alerting-services
#CC# /x-pack/plugins/stack_alerts @elastic/kibana-alerting-services
# Enterprise Search
# Shared

View file

@ -278,13 +278,6 @@ which will load the visualization's editor.
|The Kibana actions plugin provides a framework to create executable actions. You can:
|{kib-repo}blob/{branch}/x-pack/plugins/alerting_builtins/README.md[alertingBuiltins]
|This plugin provides alertTypes shipped with Kibana for use with the
the alerts plugin. When enabled, it will register
the built-in alertTypes with the alerting plugin, register associated HTTP
routes, etc.
|{kib-repo}blob/{branch}/x-pack/plugins/alerts/README.md[alerts]
|The Kibana alerting plugin provides a common place to set up alerts. You can:
@ -490,6 +483,13 @@ using the CURL scripts in the scripts folder.
|WARNING: Missing README.
|{kib-repo}blob/{branch}/x-pack/plugins/stack_alerts/README.md[stackAlerts]
|This plugin provides alertTypes shipped with Kibana for use with the
the alerts plugin. When enabled, it will register
the alertTypes by the Stack in the alerting plugin, register associated HTTP
routes, etc.
|{kib-repo}blob/{branch}/x-pack/plugins/task_manager[taskManager]
|WARNING: Missing README.

View file

@ -5,7 +5,7 @@
"xpack.uiActionsEnhanced": "plugins/ui_actions_enhanced",
"xpack.alerts": "plugins/alerts",
"xpack.eventLog": "plugins/event_log",
"xpack.alertingBuiltins": "plugins/alerting_builtins",
"xpack.stackAlerts": "plugins/stack_alerts",
"xpack.apm": "plugins/apm",
"xpack.beatsManagement": "plugins/beats_management",
"xpack.canvas": "plugins/canvas",

View file

@ -12,7 +12,7 @@ import { PluginSetupContract as FeaturesPluginSetup } from '../../../plugins/fea
import { alertType as alwaysFiringAlert } from './alert_types/always_firing';
import { alertType as peopleInSpaceAlert } from './alert_types/astros';
import { INDEX_THRESHOLD_ID } from '../../../plugins/alerting_builtins/server';
import { INDEX_THRESHOLD_ID } from '../../../plugins/stack_alerts/server';
import { ALERTING_EXAMPLE_APP_ID } from '../common/constants';
// this plugin's dependendencies

View file

@ -11,7 +11,7 @@ import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server';
export const ACTIONS_FEATURE = {
id: 'actions',
name: i18n.translate('xpack.actions.featureRegistry.actionsFeatureName', {
defaultMessage: 'Actions',
defaultMessage: 'Actions and Connectors',
}),
icon: 'bell',
navLinkId: 'actions',

View file

@ -1,8 +1,8 @@
# alerting_builtins plugin
# stack_alerts plugin
This plugin provides alertTypes shipped with Kibana for use with the
[the alerts plugin](../alerts/README.md). When enabled, it will register
the built-in alertTypes with the alerting plugin, register associated HTTP
the alertTypes by the Stack in the alerting plugin, register associated HTTP
routes, etc.
The plugin `setup` and `start` contracts for this plugin are the following
@ -18,6 +18,6 @@ export interface IService {
}
```
Each built-in alertType is described in it's own README:
Each Stack AlertType is described in it's own README:
- index threshold: [`server/alert_types/index_threshold`](server/alert_types/index_threshold/README.md)

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export const BUILT_IN_ALERTS_FEATURE_ID = 'builtInAlerts';
export const STACK_ALERTS_FEATURE_ID = 'stackAlerts';

View file

@ -1,9 +1,9 @@
{
"id": "alertingBuiltins",
"id": "stackAlerts",
"server": true,
"version": "8.0.0",
"kibanaVersion": "kibana",
"requiredPlugins": ["alerts", "features"],
"configPath": ["xpack", "alerting_builtins"],
"configPath": ["xpack", "stack_alerts"],
"ui": false
}

View file

@ -7,7 +7,7 @@
import { i18n } from '@kbn/i18n';
import { schema } from '@kbn/config-schema';
import { Service } from '../../types';
import { BUILT_IN_ALERTS_FEATURE_ID } from '../../../common';
import { STACK_ALERTS_FEATURE_ID } from '../../../common';
import { getGeoThresholdExecutor } from './geo_threshold';
import {
ActionGroup,
@ -21,28 +21,28 @@ export type TrackingEvent = 'entered' | 'exited';
export const ActionGroupId = 'tracking threshold met';
const actionVariableContextToEntityDateTimeLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextToEntityDateTimeLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextToEntityDateTimeLabel',
{
defaultMessage: `The time the entity was detected in the current boundary`,
}
);
const actionVariableContextFromEntityDateTimeLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextFromEntityDateTimeLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextFromEntityDateTimeLabel',
{
defaultMessage: `The last time the entity was recorded in the previous boundary`,
}
);
const actionVariableContextToEntityLocationLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextToEntityLocationLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextToEntityLocationLabel',
{
defaultMessage: 'The most recently captured location of the entity',
}
);
const actionVariableContextCrossingLineLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextCrossingLineLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextCrossingLineLabel',
{
defaultMessage:
'GeoJSON line connecting the two locations that were used to determine the crossing event',
@ -50,63 +50,63 @@ const actionVariableContextCrossingLineLabel = i18n.translate(
);
const actionVariableContextFromEntityLocationLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextFromEntityLocationLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextFromEntityLocationLabel',
{
defaultMessage: 'The previously captured location of the entity',
}
);
const actionVariableContextToBoundaryIdLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextCurrentBoundaryIdLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextCurrentBoundaryIdLabel',
{
defaultMessage: 'The current boundary id containing the entity (if any)',
}
);
const actionVariableContextToBoundaryNameLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextToBoundaryNameLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextToBoundaryNameLabel',
{
defaultMessage: 'The boundary (if any) the entity has crossed into and is currently located',
}
);
const actionVariableContextFromBoundaryNameLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextFromBoundaryNameLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextFromBoundaryNameLabel',
{
defaultMessage: 'The boundary (if any) the entity has crossed from and was previously located',
}
);
const actionVariableContextFromBoundaryIdLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextFromBoundaryIdLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextFromBoundaryIdLabel',
{
defaultMessage: 'The previous boundary id containing the entity (if any)',
}
);
const actionVariableContextToEntityDocumentIdLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextCrossingDocumentIdLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextCrossingDocumentIdLabel',
{
defaultMessage: 'The id of the crossing entity document',
}
);
const actionVariableContextFromEntityDocumentIdLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextFromEntityDocumentIdLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextFromEntityDocumentIdLabel',
{
defaultMessage: 'The id of the crossing entity document',
}
);
const actionVariableContextTimeOfDetectionLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextTimeOfDetectionLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextTimeOfDetectionLabel',
{
defaultMessage: 'The alert interval end time this change was recorded',
}
);
const actionVariableContextEntityIdLabel = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionVariableContextEntityIdLabel',
'xpack.stackAlerts.geoThreshold.actionVariableContextEntityIdLabel',
{
defaultMessage: 'The entity ID of the document that triggered the alert',
}
@ -206,12 +206,12 @@ export function getAlertType(
params?: ActionVariable[];
};
} {
const alertTypeName = i18n.translate('xpack.alertingBuiltins.geoThreshold.alertTypeTitle', {
const alertTypeName = i18n.translate('xpack.stackAlerts.geoThreshold.alertTypeTitle', {
defaultMessage: 'Geo tracking threshold',
});
const actionGroupName = i18n.translate(
'xpack.alertingBuiltins.geoThreshold.actionGroupThresholdMetTitle',
'xpack.stackAlerts.geoThreshold.actionGroupThresholdMetTitle',
{
defaultMessage: 'Tracking threshold met',
}
@ -223,7 +223,7 @@ export function getAlertType(
actionGroups: [{ id: ActionGroupId, name: actionGroupName }],
defaultActionGroupId: ActionGroupId,
executor: getGeoThresholdExecutor(service),
producer: BUILT_IN_ALERTS_FEATURE_ID,
producer: STACK_ALERTS_FEATURE_ID,
validate: {
params: ParamsSchema,
},

View file

@ -8,14 +8,14 @@ import { Service, IRouter, AlertingSetup } from '../types';
import { register as registerIndexThreshold } from './index_threshold';
import { register as registerGeoThreshold } from './geo_threshold';
interface RegisterBuiltInAlertTypesParams {
interface RegisterAlertTypesParams {
service: Service;
router: IRouter;
alerts: AlertingSetup;
baseRoute: string;
}
export function registerBuiltInAlertTypes(params: RegisterBuiltInAlertTypesParams) {
export function registerBuiltInAlertTypes(params: RegisterAlertTypesParams) {
registerIndexThreshold(params);
registerGeoThreshold(params);
}

View file

@ -127,9 +127,9 @@ server log [17:32:10.060] [warning][actions][actions][plugins] \
The following endpoints are provided for this alert type:
- `POST /api/alerting_builtins/index_threshold/_indices`
- `POST /api/alerting_builtins/index_threshold/_fields`
- `POST /api/alerting_builtins/index_threshold/_time_series_query`
- `POST /api/stack_alerts/index_threshold/_indices`
- `POST /api/stack_alerts/index_threshold/_fields`
- `POST /api/stack_alerts/index_threshold/_time_series_query`
### `POST .../_indices`
@ -200,7 +200,7 @@ provide a "preview" of the alert during creation/editing based on recent data,
and could be used to show a "simulation" of the the alert over an arbitrary
range of time.
The endpoint is `POST /api/alerting_builtins/index_threshold/_time_series_query`.
The endpoint is `POST /api/stack_alerts/index_threshold/_time_series_query`.
The request and response bodies are specifed in
[`lib/core_query_types.ts`][it-core-query]
and
@ -214,7 +214,7 @@ for the last 10 seconds.
This example uses [now-iso][] to generate iso date strings.
```console
curl -k "https://elastic:changeme@localhost:5601/api/alerting_builtins/index_threshold/_time_series_query" \
curl -k "https://elastic:changeme@localhost:5601/api/stack_alerts/index_threshold/_time_series_query" \
-H "kbn-xsrf: foo" -H "content-type: application/json" -d "{
\"index\": \"es-hb-sim\",
\"timeField\": \"@timestamp\",
@ -257,7 +257,7 @@ curl -k "https://elastic:changeme@localhost:5601/api/alerting_builtins/index_th
To get the current value of the calculated metric, you can leave off the date:
```
curl -k "https://elastic:changeme@localhost:5601/api/alerting_builtins/index_threshold/_time_series_query" \
curl -k "https://elastic:changeme@localhost:5601/api/stack_alerts/index_threshold/_time_series_query" \
-H "kbn-xsrf: foo" -H "content-type: application/json" -d '{
"index": "es-hb-sim",
"timeField": "@timestamp",
@ -290,7 +290,7 @@ curl -k "https://elastic:changeme@localhost:5601/api/alerting_builtins/index_th
## service functions
A single service function is available that provides the functionality
of the http endpoint `POST /api/alerting_builtins/index_threshold/_time_series_query`,
of the http endpoint `POST /api/stack_alerts/index_threshold/_time_series_query`,
but as an API for Kibana plugins. The function is available as
`alertingService.indexThreshold.timeSeriesQuery()`

View file

@ -34,23 +34,20 @@ export function addMessages(
baseContext: BaseActionContext,
params: Params
): ActionContext {
const title = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.alertTypeContextSubjectTitle',
{
defaultMessage: 'alert {name} group {group} exceeded threshold',
values: {
name: alertInfo.name,
group: baseContext.group,
},
}
);
const title = i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeContextSubjectTitle', {
defaultMessage: 'alert {name} group {group} exceeded threshold',
values: {
name: alertInfo.name,
group: baseContext.group,
},
});
const agg = params.aggField ? `${params.aggType}(${params.aggField})` : `${params.aggType}`;
const humanFn = `${agg} ${params.thresholdComparator} ${params.threshold.join(',')}`;
const window = `${params.timeWindowSize}${params.timeWindowUnit}`;
const message = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.alertTypeContextMessageDescription',
'xpack.stackAlerts.indexThreshold.alertTypeContextMessageDescription',
{
defaultMessage:
'alert {name} group {group} value {value} exceeded threshold {function} over {window} on {date}',

View file

@ -10,7 +10,7 @@ import { Params, ParamsSchema } from './alert_type_params';
import { ActionContext, BaseActionContext, addMessages } from './action_context';
import { TimeSeriesQuery } from './lib/time_series_query';
import { Service } from '../../types';
import { BUILT_IN_ALERTS_FEATURE_ID } from '../../../common';
import { STACK_ALERTS_FEATURE_ID } from '../../../common';
export const ID = '.index-threshold';
@ -22,54 +22,54 @@ export const ComparatorFnNames = new Set(ComparatorFns.keys());
export function getAlertType(service: Service): AlertType<Params, {}, {}, ActionContext> {
const { logger } = service;
const alertTypeName = i18n.translate('xpack.alertingBuiltins.indexThreshold.alertTypeTitle', {
const alertTypeName = i18n.translate('xpack.stackAlerts.indexThreshold.alertTypeTitle', {
defaultMessage: 'Index threshold',
});
const actionGroupName = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.actionGroupThresholdMetTitle',
'xpack.stackAlerts.indexThreshold.actionGroupThresholdMetTitle',
{
defaultMessage: 'Threshold Met',
}
);
const actionVariableContextGroupLabel = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.actionVariableContextGroupLabel',
'xpack.stackAlerts.indexThreshold.actionVariableContextGroupLabel',
{
defaultMessage: 'The group that exceeded the threshold.',
}
);
const actionVariableContextDateLabel = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.actionVariableContextDateLabel',
'xpack.stackAlerts.indexThreshold.actionVariableContextDateLabel',
{
defaultMessage: 'The date the alert exceeded the threshold.',
}
);
const actionVariableContextValueLabel = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.actionVariableContextValueLabel',
'xpack.stackAlerts.indexThreshold.actionVariableContextValueLabel',
{
defaultMessage: 'The value that exceeded the threshold.',
}
);
const actionVariableContextMessageLabel = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.actionVariableContextMessageLabel',
'xpack.stackAlerts.indexThreshold.actionVariableContextMessageLabel',
{
defaultMessage: 'A pre-constructed message for the alert.',
}
);
const actionVariableContextTitleLabel = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.actionVariableContextTitleLabel',
'xpack.stackAlerts.indexThreshold.actionVariableContextTitleLabel',
{
defaultMessage: 'A pre-constructed title for the alert.',
}
);
const actionVariableContextThresholdLabel = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.actionVariableContextThresholdLabel',
'xpack.stackAlerts.indexThreshold.actionVariableContextThresholdLabel',
{
defaultMessage:
"An array of values to use as the threshold; 'between' and 'notBetween' require two values, the others require one.",
@ -77,7 +77,7 @@ export function getAlertType(service: Service): AlertType<Params, {}, {}, Action
);
const actionVariableContextThresholdComparatorLabel = i18n.translate(
'xpack.alertingBuiltins.indexThreshold.actionVariableContextThresholdComparatorLabel',
'xpack.stackAlerts.indexThreshold.actionVariableContextThresholdComparatorLabel',
{
defaultMessage: 'A comparison function to use to determine if the threshold as been met.',
}
@ -115,7 +115,7 @@ export function getAlertType(service: Service): AlertType<Params, {}, {}, Action
],
},
executor,
producer: BUILT_IN_ALERTS_FEATURE_ID,
producer: STACK_ALERTS_FEATURE_ID,
};
async function executor(options: AlertExecutorOptions<Params, {}, {}, ActionContext>) {
@ -174,7 +174,7 @@ export function getAlertType(service: Service): AlertType<Params, {}, {}, Action
}
export function getInvalidComparatorMessage(comparator: string) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.invalidComparatorErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.invalidComparatorErrorMessage', {
defaultMessage: 'invalid thresholdComparator specified: {comparator}',
values: {
comparator,

View file

@ -38,7 +38,7 @@ function validateParams(anyParams: unknown): string | undefined {
const { thresholdComparator, threshold }: Params = anyParams as Params;
if (betweenComparators.has(thresholdComparator) && threshold.length === 1) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.invalidThreshold2ErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.invalidThreshold2ErrorMessage', {
defaultMessage:
'[threshold]: must have two elements for the "{thresholdComparator}" comparator',
values: {

View file

@ -51,7 +51,7 @@ export function validateCoreQueryBody(anyParams: unknown): string | undefined {
termSize,
}: CoreQueryParams = anyParams as CoreQueryParams;
if (aggType !== 'count' && !aggField) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.aggTypeRequiredErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.aggTypeRequiredErrorMessage', {
defaultMessage: '[aggField]: must have a value when [aggType] is "{aggType}"',
values: {
aggType,
@ -62,25 +62,22 @@ export function validateCoreQueryBody(anyParams: unknown): string | undefined {
// check grouping
if (groupBy === 'top') {
if (termField == null) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.termFieldRequiredErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.termFieldRequiredErrorMessage', {
defaultMessage: '[termField]: termField required when [groupBy] is top',
});
}
if (termSize == null) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.termSizeRequiredErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.termSizeRequiredErrorMessage', {
defaultMessage: '[termSize]: termSize required when [groupBy] is top',
});
}
if (termSize > MAX_GROUPS) {
return i18n.translate(
'xpack.alertingBuiltins.indexThreshold.invalidTermSizeMaximumErrorMessage',
{
defaultMessage: '[termSize]: must be less than or equal to {maxGroups}',
values: {
maxGroups: MAX_GROUPS,
},
}
);
return i18n.translate('xpack.stackAlerts.indexThreshold.invalidTermSizeMaximumErrorMessage', {
defaultMessage: '[termSize]: must be less than or equal to {maxGroups}',
values: {
maxGroups: MAX_GROUPS,
},
});
}
}
}
@ -92,7 +89,7 @@ function validateAggType(aggType: string): string | undefined {
return;
}
return i18n.translate('xpack.alertingBuiltins.indexThreshold.invalidAggTypeErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.invalidAggTypeErrorMessage', {
defaultMessage: 'invalid aggType: "{aggType}"',
values: {
aggType,
@ -105,7 +102,7 @@ export function validateGroupBy(groupBy: string): string | undefined {
return;
}
return i18n.translate('xpack.alertingBuiltins.indexThreshold.invalidGroupByErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.invalidGroupByErrorMessage', {
defaultMessage: 'invalid groupBy: "{groupBy}"',
values: {
groupBy,
@ -120,13 +117,10 @@ export function validateTimeWindowUnits(timeWindowUnit: string): string | undefi
return;
}
return i18n.translate(
'xpack.alertingBuiltins.indexThreshold.invalidTimeWindowUnitsErrorMessage',
{
defaultMessage: 'invalid timeWindowUnit: "{timeWindowUnit}"',
values: {
timeWindowUnit,
},
}
);
return i18n.translate('xpack.stackAlerts.indexThreshold.invalidTimeWindowUnitsErrorMessage', {
defaultMessage: 'invalid timeWindowUnit: "{timeWindowUnit}"',
values: {
timeWindowUnit,
},
});
}

View file

@ -100,7 +100,7 @@ function getDuration(durationS: string, field: string): number {
}
function getParseErrorMessage(formatName: string, fieldName: string, fieldValue: string) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.formattedFieldErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.formattedFieldErrorMessage', {
defaultMessage: 'invalid {formatName} format for {fieldName}: "{fieldValue}"',
values: {
formatName,
@ -111,7 +111,7 @@ function getParseErrorMessage(formatName: string, fieldName: string, fieldValue:
}
export function getTooManyIntervalsErrorMessage(intervals: number, maxIntervals: number) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.maxIntervalsErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.maxIntervalsErrorMessage', {
defaultMessage:
'calculated number of intervals {intervals} is greater than maximum {maxIntervals}',
values: {
@ -122,7 +122,7 @@ export function getTooManyIntervalsErrorMessage(intervals: number, maxIntervals:
}
export function getDateStartAfterDateEndErrorMessage(): string {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.dateStartGTdateEndErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.dateStartGTdateEndErrorMessage', {
defaultMessage: '[dateStart]: is greater than [dateEnd]',
});
}

View file

@ -66,7 +66,7 @@ function validateBody(anyParams: unknown): string | undefined {
}
if (epochStart !== epochEnd && !interval) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.intervalRequiredErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.intervalRequiredErrorMessage', {
defaultMessage: '[interval]: must be specified if [dateStart] does not equal [dateEnd]',
});
}
@ -84,7 +84,7 @@ function validateBody(anyParams: unknown): string | undefined {
function validateDate(dateString: string): string | undefined {
const parsed = Date.parse(dateString);
if (isNaN(parsed)) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.invalidDateErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.invalidDateErrorMessage', {
defaultMessage: 'invalid date {date}',
values: {
date: dateString,
@ -97,7 +97,7 @@ export function validateDuration(duration: string): string | undefined {
try {
parseDuration(duration);
} catch (err) {
return i18n.translate('xpack.alertingBuiltins.indexThreshold.invalidDurationErrorMessage', {
return i18n.translate('xpack.stackAlerts.indexThreshold.invalidDurationErrorMessage', {
defaultMessage: 'invalid duration: "{duration}"',
values: {
duration,

View file

@ -7,13 +7,13 @@
import { i18n } from '@kbn/i18n';
import { ID as IndexThreshold } from './alert_types/index_threshold/alert_type';
import { GEO_THRESHOLD_ID as GeoThreshold } from './alert_types/geo_threshold/alert_type';
import { BUILT_IN_ALERTS_FEATURE_ID } from '../common';
import { STACK_ALERTS_FEATURE_ID } from '../common';
import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server';
export const BUILT_IN_ALERTS_FEATURE = {
id: BUILT_IN_ALERTS_FEATURE_ID,
name: i18n.translate('xpack.alertingBuiltins.featureRegistry.actionsFeatureName', {
defaultMessage: 'Built-In Alerts',
id: STACK_ALERTS_FEATURE_ID,
name: i18n.translate('xpack.stackAlerts.featureRegistry.actionsFeatureName', {
defaultMessage: 'Stack Alerts',
}),
icon: 'bell',
app: [],

View file

@ -6,7 +6,7 @@
import { Plugin, Logger, CoreSetup, CoreStart, PluginInitializerContext } from 'src/core/server';
import { Service, IService, AlertingBuiltinsDeps } from './types';
import { Service, IService, StackAlertsDeps } from './types';
import { getService as getServiceIndexThreshold } from './alert_types/index_threshold';
import { registerBuiltInAlertTypes } from './alert_types';
import { BUILT_IN_ALERTS_FEATURE } from './feature';
@ -23,17 +23,14 @@ export class AlertingBuiltinsPlugin implements Plugin<IService, IService> {
};
}
public async setup(
core: CoreSetup,
{ alerts, features }: AlertingBuiltinsDeps
): Promise<IService> {
public async setup(core: CoreSetup, { alerts, features }: StackAlertsDeps): Promise<IService> {
features.registerKibanaFeature(BUILT_IN_ALERTS_FEATURE);
registerBuiltInAlertTypes({
service: this.service,
router: core.http.createRouter(),
alerts,
baseRoute: '/api/alerting_builtins',
baseRoute: '/api/stack_alerts',
});
return this.service;
}

View file

@ -18,7 +18,7 @@ export {
import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server';
// this plugin's dependendencies
export interface AlertingBuiltinsDeps {
export interface StackAlertsDeps {
alerts: AlertingSetup;
features: FeaturesPluginSetup;
}

View file

@ -4431,30 +4431,30 @@
"xpack.actions.serverSideErrors.predefinedActionUpdateDisabled": "あらかじめ構成されたアクション{id}は更新できません。",
"xpack.actions.serverSideErrors.unavailableLicenseErrorMessage": "現時点でライセンス情報を入手できないため、アクションタイプ {actionTypeId} は無効です。",
"xpack.actions.serverSideErrors.unavailableLicenseInformationErrorMessage": "グラフを利用できません。現在ライセンス情報が利用できません。",
"xpack.alertingBuiltins.indexThreshold.actionGroupThresholdMetTitle": "しきい値一致",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextDateLabel": "アラートがしきい値を超えた日付。",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextGroupLabel": "しきい値を超えたグループ。",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextMessageLabel": "アラートの事前構成メッセージ。",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextTitleLabel": "アラートの事前構成タイトル。",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextValueLabel": "しきい値を超えた値。",
"xpack.alertingBuiltins.indexThreshold.aggTypeRequiredErrorMessage": "[aggType] が「{aggType}」のときには [aggField] に値が必要です",
"xpack.alertingBuiltins.indexThreshold.alertTypeContextMessageDescription": "アラート {name} グループ {group} 値 {value} が {date} に {window} にわたってしきい値 {function} を超えました",
"xpack.alertingBuiltins.indexThreshold.alertTypeContextSubjectTitle": "アラート {name} グループ {group} がしきい値を超えました",
"xpack.alertingBuiltins.indexThreshold.alertTypeTitle": "インデックスしきい値",
"xpack.alertingBuiltins.indexThreshold.dateStartGTdateEndErrorMessage": "[dateStart] が [dateEnd] よりも大です",
"xpack.alertingBuiltins.indexThreshold.formattedFieldErrorMessage": "{fieldName} の無効な {formatName} 形式:「{fieldValue}」",
"xpack.alertingBuiltins.indexThreshold.intervalRequiredErrorMessage": "[interval]: [dateStart] が [dateEnd] と等しくない場合に指定する必要があります",
"xpack.alertingBuiltins.indexThreshold.invalidAggTypeErrorMessage": "無効な aggType:「{aggType}」",
"xpack.alertingBuiltins.indexThreshold.invalidComparatorErrorMessage": "無効な thresholdComparator が指定されました: {comparator}",
"xpack.alertingBuiltins.indexThreshold.invalidDateErrorMessage": "無効な日付 {date}",
"xpack.alertingBuiltins.indexThreshold.invalidDurationErrorMessage": "無効な期間:「{duration}」",
"xpack.alertingBuiltins.indexThreshold.invalidGroupByErrorMessage": "無効な groupBy:「{groupBy}」",
"xpack.alertingBuiltins.indexThreshold.invalidTermSizeMaximumErrorMessage": "[termSize]: {maxGroups} 以下でなければなりません。",
"xpack.alertingBuiltins.indexThreshold.invalidThreshold2ErrorMessage": "[threshold]: 「{thresholdComparator}」比較子の場合には 2 つの要素が必要です",
"xpack.alertingBuiltins.indexThreshold.invalidTimeWindowUnitsErrorMessage": "無効な timeWindowUnit:「{timeWindowUnit}」",
"xpack.alertingBuiltins.indexThreshold.maxIntervalsErrorMessage": "間隔 {intervals} の計算値が {maxIntervals} よりも大です",
"xpack.alertingBuiltins.indexThreshold.termFieldRequiredErrorMessage": "[termField]: [groupBy] がトップのときには termField が必要です",
"xpack.alertingBuiltins.indexThreshold.termSizeRequiredErrorMessage": "[termSize]: [groupBy] がトップのときには termSize が必要です",
"xpack.stackAlerts.indexThreshold.actionGroupThresholdMetTitle": "しきい値一致",
"xpack.stackAlerts.indexThreshold.actionVariableContextDateLabel": "アラートがしきい値を超えた日付。",
"xpack.stackAlerts.indexThreshold.actionVariableContextGroupLabel": "しきい値を超えたグループ。",
"xpack.stackAlerts.indexThreshold.actionVariableContextMessageLabel": "アラートの事前構成メッセージ。",
"xpack.stackAlerts.indexThreshold.actionVariableContextTitleLabel": "アラートの事前構成タイトル。",
"xpack.stackAlerts.indexThreshold.actionVariableContextValueLabel": "しきい値を超えた値。",
"xpack.stackAlerts.indexThreshold.aggTypeRequiredErrorMessage": "[aggType] が「{aggType}」のときには [aggField] に値が必要です",
"xpack.stackAlerts.indexThreshold.alertTypeContextMessageDescription": "アラート {name} グループ {group} 値 {value} が {date} に {window} にわたってしきい値 {function} を超えました",
"xpack.stackAlerts.indexThreshold.alertTypeContextSubjectTitle": "アラート {name} グループ {group} がしきい値を超えました",
"xpack.stackAlerts.indexThreshold.alertTypeTitle": "インデックスしきい値",
"xpack.stackAlerts.indexThreshold.dateStartGTdateEndErrorMessage": "[dateStart] が [dateEnd] よりも大です",
"xpack.stackAlerts.indexThreshold.formattedFieldErrorMessage": "{fieldName} の無効な {formatName} 形式:「{fieldValue}」",
"xpack.stackAlerts.indexThreshold.intervalRequiredErrorMessage": "[interval]: [dateStart] が [dateEnd] と等しくない場合に指定する必要があります",
"xpack.stackAlerts.indexThreshold.invalidAggTypeErrorMessage": "無効な aggType:「{aggType}」",
"xpack.stackAlerts.indexThreshold.invalidComparatorErrorMessage": "無効な thresholdComparator が指定されました: {comparator}",
"xpack.stackAlerts.indexThreshold.invalidDateErrorMessage": "無効な日付 {date}",
"xpack.stackAlerts.indexThreshold.invalidDurationErrorMessage": "無効な期間:「{duration}」",
"xpack.stackAlerts.indexThreshold.invalidGroupByErrorMessage": "無効な groupBy:「{groupBy}」",
"xpack.stackAlerts.indexThreshold.invalidTermSizeMaximumErrorMessage": "[termSize]: {maxGroups} 以下でなければなりません。",
"xpack.stackAlerts.indexThreshold.invalidThreshold2ErrorMessage": "[threshold]: 「{thresholdComparator}」比較子の場合には 2 つの要素が必要です",
"xpack.stackAlerts.indexThreshold.invalidTimeWindowUnitsErrorMessage": "無効な timeWindowUnit:「{timeWindowUnit}」",
"xpack.stackAlerts.indexThreshold.maxIntervalsErrorMessage": "間隔 {intervals} の計算値が {maxIntervals} よりも大です",
"xpack.stackAlerts.indexThreshold.termFieldRequiredErrorMessage": "[termField]: [groupBy] がトップのときには termField が必要です",
"xpack.stackAlerts.indexThreshold.termSizeRequiredErrorMessage": "[termSize]: [groupBy] がトップのときには termSize が必要です",
"xpack.alerts.alertNavigationRegistry.get.missingNavigationError": "「{consumer}」内のアラートタイプ「{alertType}」のナビゲーションは登録されていません。",
"xpack.alerts.alertNavigationRegistry.register.duplicateDefaultError": "「{consumer}」内のデフォルトナビゲーションはすでに登録されています。",
"xpack.alerts.alertNavigationRegistry.register.duplicateNavigationError": "「{consumer}」内のアラートタイプ「{alertType}」のナビゲーションはすでに登録されています。",

View file

@ -4432,30 +4432,30 @@
"xpack.actions.serverSideErrors.predefinedActionUpdateDisabled": "不允许更新预配置的操作 {id}。",
"xpack.actions.serverSideErrors.unavailableLicenseErrorMessage": "操作类型 {actionTypeId} 已禁用,因为许可证信息当前不可用。",
"xpack.actions.serverSideErrors.unavailableLicenseInformationErrorMessage": "操作不可用 - 许可信息当前不可用。",
"xpack.alertingBuiltins.indexThreshold.actionGroupThresholdMetTitle": "阈值已达到",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextDateLabel": "告警超过阈值的日期。",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextGroupLabel": "超过阈值的组。",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextMessageLabel": "告警的预构造消息。",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextTitleLabel": "告警的预构造标题。",
"xpack.alertingBuiltins.indexThreshold.actionVariableContextValueLabel": "超过阈值的值。",
"xpack.alertingBuiltins.indexThreshold.aggTypeRequiredErrorMessage": "[aggField]:当 [aggType] 为“{aggType}”时必须有值",
"xpack.alertingBuiltins.indexThreshold.alertTypeContextMessageDescription": "告警 {name} 组 {group} 值 {value} 在 {window} 于 {date}超过阈值 {function}",
"xpack.alertingBuiltins.indexThreshold.alertTypeContextSubjectTitle": "告警 {name} 组 {group} 超过阈值",
"xpack.alertingBuiltins.indexThreshold.alertTypeTitle": "索引阈值",
"xpack.alertingBuiltins.indexThreshold.dateStartGTdateEndErrorMessage": "[dateStart]:大于 [dateEnd]",
"xpack.alertingBuiltins.indexThreshold.formattedFieldErrorMessage": "{fieldName} 的 {formatName} 格式无效:“{fieldValue}”",
"xpack.alertingBuiltins.indexThreshold.intervalRequiredErrorMessage": "[interval]:如果 [dateStart] 不等于 [dateEnd],则必须指定",
"xpack.alertingBuiltins.indexThreshold.invalidAggTypeErrorMessage": "无效的 aggType“{aggType}”",
"xpack.alertingBuiltins.indexThreshold.invalidComparatorErrorMessage": "指定了无效的 thresholdComparator{comparator}",
"xpack.alertingBuiltins.indexThreshold.invalidDateErrorMessage": "无效的日期 {date}",
"xpack.alertingBuiltins.indexThreshold.invalidDurationErrorMessage": "无效的持续时间:“{duration}”",
"xpack.alertingBuiltins.indexThreshold.invalidGroupByErrorMessage": "无效的 groupBy“{groupBy}”",
"xpack.alertingBuiltins.indexThreshold.invalidTermSizeMaximumErrorMessage": "[termSize]:必须小于或等于 {maxGroups}",
"xpack.alertingBuiltins.indexThreshold.invalidThreshold2ErrorMessage": "[threshold]:对于“{thresholdComparator}”比较运算符,必须包含两个元素",
"xpack.alertingBuiltins.indexThreshold.invalidTimeWindowUnitsErrorMessage": "无效的 timeWindowUnit“{timeWindowUnit}”",
"xpack.alertingBuiltins.indexThreshold.maxIntervalsErrorMessage": "时间间隔 {intervals} 的计算数目大于最大值 {maxIntervals}",
"xpack.alertingBuiltins.indexThreshold.termFieldRequiredErrorMessage": "[termField][groupBy] 为 top 时,必需 termField",
"xpack.alertingBuiltins.indexThreshold.termSizeRequiredErrorMessage": "[termSize][groupBy] 为 top 时,必需 termSize",
"xpack.stackAlerts.indexThreshold.actionGroupThresholdMetTitle": "阈值已达到",
"xpack.stackAlerts.indexThreshold.actionVariableContextDateLabel": "告警超过阈值的日期。",
"xpack.stackAlerts.indexThreshold.actionVariableContextGroupLabel": "超过阈值的组。",
"xpack.stackAlerts.indexThreshold.actionVariableContextMessageLabel": "告警的预构造消息。",
"xpack.stackAlerts.indexThreshold.actionVariableContextTitleLabel": "告警的预构造标题。",
"xpack.stackAlerts.indexThreshold.actionVariableContextValueLabel": "超过阈值的值。",
"xpack.stackAlerts.indexThreshold.aggTypeRequiredErrorMessage": "[aggField]:当 [aggType] 为“{aggType}”时必须有值",
"xpack.stackAlerts.indexThreshold.alertTypeContextMessageDescription": "告警 {name} 组 {group} 值 {value} 在 {window} 于 {date}超过阈值 {function}",
"xpack.stackAlerts.indexThreshold.alertTypeContextSubjectTitle": "告警 {name} 组 {group} 超过阈值",
"xpack.stackAlerts.indexThreshold.alertTypeTitle": "索引阈值",
"xpack.stackAlerts.indexThreshold.dateStartGTdateEndErrorMessage": "[dateStart]:大于 [dateEnd]",
"xpack.stackAlerts.indexThreshold.formattedFieldErrorMessage": "{fieldName} 的 {formatName} 格式无效:“{fieldValue}”",
"xpack.stackAlerts.indexThreshold.intervalRequiredErrorMessage": "[interval]:如果 [dateStart] 不等于 [dateEnd],则必须指定",
"xpack.stackAlerts.indexThreshold.invalidAggTypeErrorMessage": "无效的 aggType“{aggType}”",
"xpack.stackAlerts.indexThreshold.invalidComparatorErrorMessage": "指定了无效的 thresholdComparator{comparator}",
"xpack.stackAlerts.indexThreshold.invalidDateErrorMessage": "无效的日期 {date}",
"xpack.stackAlerts.indexThreshold.invalidDurationErrorMessage": "无效的持续时间:“{duration}”",
"xpack.stackAlerts.indexThreshold.invalidGroupByErrorMessage": "无效的 groupBy“{groupBy}”",
"xpack.stackAlerts.indexThreshold.invalidTermSizeMaximumErrorMessage": "[termSize]:必须小于或等于 {maxGroups}",
"xpack.stackAlerts.indexThreshold.invalidThreshold2ErrorMessage": "[threshold]:对于“{thresholdComparator}”比较运算符,必须包含两个元素",
"xpack.stackAlerts.indexThreshold.invalidTimeWindowUnitsErrorMessage": "无效的 timeWindowUnit“{timeWindowUnit}”",
"xpack.stackAlerts.indexThreshold.maxIntervalsErrorMessage": "时间间隔 {intervals} 的计算数目大于最大值 {maxIntervals}",
"xpack.stackAlerts.indexThreshold.termFieldRequiredErrorMessage": "[termField][groupBy] 为 top 时,必需 termField",
"xpack.stackAlerts.indexThreshold.termSizeRequiredErrorMessage": "[termSize][groupBy] 为 top 时,必需 termSize",
"xpack.alerts.alertNavigationRegistry.get.missingNavigationError": "在“{consumer}”内针对告警类型“{alertType}”的导航未注册。",
"xpack.alerts.alertNavigationRegistry.register.duplicateDefaultError": "“{consumer}”内的默认导航已注册。",
"xpack.alerts.alertNavigationRegistry.register.duplicateNavigationError": "在“{consumer}”内针对告警类型“{alertType}”的导航已注册。",

View file

@ -3,7 +3,7 @@
"version": "kibana",
"server": true,
"ui": true,
"optionalPlugins": ["alerts", "alertingBuiltins"],
"optionalPlugins": ["alerts", "stackAlerts"],
"requiredPlugins": ["management", "charts", "data", "kibanaReact"],
"configPath": ["xpack", "trigger_actions_ui"],
"extraPublicDirs": ["public/common", "public/common/constants"],

View file

@ -4,9 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { HttpSetup } from 'kibana/public';
import { TimeSeriesResult } from '../../../../alerting_builtins/common/alert_types/index_threshold';
import { TimeSeriesResult } from '../../../../stack_alerts/common/alert_types/index_threshold';
const INDEX_THRESHOLD_API_ROOT = '/api/alerting_builtins/index_threshold';
const INDEX_THRESHOLD_API_ROOT = '/api/stack_alerts/index_threshold';
export async function getMatchingIndicesForThresholdAlertType({
pattern,

View file

@ -10,7 +10,7 @@ import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { ESTestIndexTool, ES_TEST_INDEX_NAME, getUrlPrefix } from '../../../../../common/lib';
const API_URI = 'api/alerting_builtins/index_threshold/_fields';
const API_URI = 'api/stack_alerts/index_threshold/_fields';
// eslint-disable-next-line import/no-default-export
export default function fieldsEndpointTests({ getService }: FtrProviderContext) {

View file

@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { ESTestIndexTool, ES_TEST_INDEX_NAME, getUrlPrefix } from '../../../../../common/lib';
import { createEsDocuments } from './create_test_data';
const API_URI = 'api/alerting_builtins/index_threshold/_indices';
const API_URI = 'api/stack_alerts/index_threshold/_indices';
// eslint-disable-next-line import/no-default-export
export default function indicesEndpointTests({ getService }: FtrProviderContext) {

View file

@ -9,12 +9,11 @@ import expect from '@kbn/expect';
import { Spaces } from '../../../../scenarios';
import { FtrProviderContext } from '../../../../../common/ftr_provider_context';
import { ESTestIndexTool, ES_TEST_INDEX_NAME, getUrlPrefix } from '../../../../../common/lib';
import { TimeSeriesQuery } from '../../../../../../../plugins/alerting_builtins/server/alert_types/index_threshold/lib/time_series_query';
import { TimeSeriesQuery } from '../../../../../../../plugins/stack_alerts/server/alert_types/index_threshold/lib/time_series_query';
import { createEsDocuments } from './create_test_data';
const INDEX_THRESHOLD_TIME_SERIES_QUERY_URL =
'api/alerting_builtins/index_threshold/_time_series_query';
const INDEX_THRESHOLD_TIME_SERIES_QUERY_URL = 'api/stack_alerts/index_threshold/_time_series_query';
const START_DATE_MM_DD_HH_MM_SS_MS = '01-01T00:00:00.000Z';
const START_DATE = `2020-${START_DATE_MM_DD_HH_MM_SS_MS}`;

View file

@ -107,7 +107,7 @@ export default function ({ getService }: FtrProviderContext) {
'savedObjectsManagement',
'ml',
'apm',
'builtInAlerts',
'stackAlerts',
'canvas',
'infrastructure',
'logs',

View file

@ -38,7 +38,7 @@ export default function ({ getService }: FtrProviderContext) {
ml: ['all', 'read'],
siem: ['all', 'read'],
ingestManager: ['all', 'read'],
builtInAlerts: ['all', 'read'],
stackAlerts: ['all', 'read'],
actions: ['all', 'read'],
},
global: ['all', 'read'],

View file

@ -36,7 +36,7 @@ export default function ({ getService }: FtrProviderContext) {
ml: ['all', 'read'],
siem: ['all', 'read'],
ingestManager: ['all', 'read'],
builtInAlerts: ['all', 'read'],
stackAlerts: ['all', 'read'],
actions: ['all', 'read'],
},
global: ['all', 'read'],