Skip to content

Commit

Permalink
Rename some alert types (#61693) (#62298)
Browse files Browse the repository at this point in the history
* Rename some alert types

* Use sentence case for remaining changes + fix jest test

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
mikecote and elasticmachine authored Apr 2, 2020
1 parent 5c1516c commit e57ef04
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const rulesNotificationAlertType = ({
logger: Logger;
}): NotificationAlertTypeDefinition => ({
id: NOTIFICATIONS_ID,
name: 'SIEM Notifications',
name: 'SIEM notification',
actionGroups: siemRuleActionGroups,
defaultActionGroupId: 'default',
validate: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const signalRulesAlertType = ({
}): SignalRuleAlertTypeDefinition => {
return {
id: SIGNALS_ID,
name: 'SIEM Signals',
name: 'SIEM signal',
actionGroups: siemRuleActionGroups,
defaultActionGroupId: 'default',
validate: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('monitor status alert type', () => {
{{context.downMonitorsWithGeo}}",
"iconClass": "uptimeApp",
"id": "xpack.uptime.alerts.monitorStatus",
"name": "Uptime Monitor Status",
"name": "Uptime monitor status",
"validate": [Function],
}
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const initMonitorStatusAlertType: AlertTypeInitializer = ({
autocomplete,
}): AlertTypeModel => ({
id: 'xpack.uptime.alerts.monitorStatus',
name: 'Uptime Monitor Status',
name: 'Uptime monitor status',
iconClass: 'uptimeApp',
alertParamsExpression: params => {
return <AlertMonitorStatus {...params} autocomplete={autocomplete} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('alertType', () => {

it('alert type creation structure is the expected value', async () => {
expect(alertType.id).toBe('.index-threshold');
expect(alertType.name).toBe('Index Threshold');
expect(alertType.name).toBe('Index threshold');
expect(alertType.actionGroups).toEqual([{ id: 'threshold met', name: 'Threshold Met' }]);

expect(alertType.actionVariables).toMatchInlineSnapshot(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function getAlertType(service: Service): AlertType {
const { logger } = service;

const alertTypeName = i18n.translate('xpack.alertingBuiltins.indexThreshold.alertTypeTitle', {
defaultMessage: 'Index Threshold',
defaultMessage: 'Index threshold',
});

const actionGroupName = i18n.translate(
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerting_builtins/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('AlertingBuiltins Plugin', () => {
},
],
"id": ".index-threshold",
"name": "Index Threshold",
"name": "Index threshold",
}
`);
});
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/common/alert_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export enum AlertType {
export const ALERT_TYPES_CONFIG = {
[AlertType.ErrorRate]: {
name: i18n.translate('xpack.apm.errorRateAlert.name', {
defaultMessage: 'Error rate threshold'
defaultMessage: 'Error rate'
}),
actionGroups: [
{
Expand All @@ -28,7 +28,7 @@ export const ALERT_TYPES_CONFIG = {
},
[AlertType.TransactionDuration]: {
name: i18n.translate('xpack.apm.transactionDurationAlert.name', {
defaultMessage: 'Transaction duration threshold'
defaultMessage: 'Transaction duration'
}),
actionGroups: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function getAlertType(): AlertTypeModel {
return {
id: METRIC_THRESHOLD_ALERT_TYPE_ID,
name: i18n.translate('xpack.infra.metrics.alertFlyout.alertName', {
defaultMessage: 'Metric Threshold',
defaultMessage: 'Metric threshold',
}),
iconClass: 'bell',
alertParamsExpression: Expressions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function registerMetricThresholdAlertType(alertingPlugin: PluginSet

alertingPlugin.registerType({
id: METRIC_THRESHOLD_ALERT_TYPE_ID,
name: 'Metric Alert - Threshold',
name: 'Metric threshold',
validate: {
params: schema.object({
criteria: schema.arrayOf(schema.oneOf([countCriterion, nonCountCriterion])),
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/triggers_actions_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ AlertTypeModel:
export function getAlertType(): AlertTypeModel {
return {
id: '.index-threshold',
name: 'Index Threshold',
name: 'Index threshold',
iconClass: 'alert',
alertParamsExpression: IndexThresholdAlertTypeExpression,
validate: validateAlertType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ describe('status check alert', () => {

it('contains the expected static fields like id, name, etc.', () => {
expect(alert.id).toBe('xpack.uptime.alerts.monitorStatus');
expect(alert.name).toBe('Uptime Monitor Status');
expect(alert.name).toBe('Uptime monitor status');
expect(alert.defaultActionGroupId).toBe('xpack.uptime.alerts.actionGroups.monitorStatus');
expect(alert.actionGroups).toMatchInlineSnapshot(`
Array [
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/uptime/server/lib/alerts/status_check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const DEFAULT_MAX_MESSAGE_ROWS = 3;
export const statusCheckAlertFactory: UptimeAlertTypeFactory = (server, libs) => ({
id: 'xpack.uptime.alerts.monitorStatus',
name: i18n.translate('xpack.uptime.alerts.monitorStatus', {
defaultMessage: 'Uptime Monitor Status',
defaultMessage: 'Uptime monitor status',
}),
validate: {
params: schema.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
{
name: alertName,
tagsText: '',
alertType: 'Index Threshold',
alertType: 'Index threshold',
interval: '1m',
},
]);
Expand Down Expand Up @@ -154,7 +154,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
{
name: createdAlert.name,
tagsText: 'foo, bar',
alertType: 'Index Threshold',
alertType: 'Index threshold',
interval: '1m',
},
]);
Expand All @@ -179,7 +179,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
{
name: updatedAlertName,
tagsText: 'foo, bar',
alertType: 'Index Threshold',
alertType: 'Index threshold',
interval: '1m',
},
]);
Expand Down Expand Up @@ -210,7 +210,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
{
name: createdAlert.name,
tagsText: 'foo, bar',
alertType: 'Index Threshold',
alertType: 'Index threshold',
interval: '1m',
},
]);
Expand Down Expand Up @@ -260,7 +260,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
{
name: createdAlert.name,
tagsText: 'foo, bar',
alertType: 'Index Threshold',
alertType: 'Index threshold',
interval: '1m',
},
]);
Expand Down

0 comments on commit e57ef04

Please sign in to comment.