Skip to content

Commit

Permalink
Renames "Built-In Alerts" feature to "Stack Alerts" and "Actions" fea…
Browse files Browse the repository at this point in the history
…ture 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.
  • Loading branch information
gmmorris authored Oct 6, 2020
1 parent edbf6b8 commit 25c5daa
Show file tree
Hide file tree
Showing 55 changed files with 154 additions and 169 deletions.
4 changes: 1 addition & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/examples/alerting_example/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -21,92 +21,92 @@ 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',
}
);

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',
}
Expand Down Expand Up @@ -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',
}
Expand All @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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
Expand All @@ -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\",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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()`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
Loading

0 comments on commit 25c5daa

Please sign in to comment.