Skip to content

Commit

Permalink
Change description of context.group action variable (#150104)
Browse files Browse the repository at this point in the history
## Summary

This PR changes the description of `context.group` action variable in
Metric threshold rule and Log threshold rule. The background of this
change can be found in [this
PR](#149071 (comment)).

## Metric threshold rule
**Old description:** Name of the group reporting data
**New description:** Name of the group(s) reporting data. For accessing
each group key, use context.groupByKeys.

<img width="323" alt="Screenshot 2023-02-01 at 21 30 34"
src="https://user-images.githubusercontent.com/69037875/216156662-24e65c80-4592-4f0b-b54f-5a64d72326d2.png">

## Log threshold rule
**Old description:** The name of the group responsible for triggering
the alert
**New description:** The name of the group(s) responsible for triggering
the alert. For accessing each group key, use context.groupByKeys.

<img width="319" alt="Screenshot 2023-02-01 at 21 26 41"
src="https://user-images.githubusercontent.com/69037875/216156464-9a31f0ac-7450-435d-b56d-e72da2d82d49.png">

@maciejforcone please let me know in case the wording should be changed.

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
  • Loading branch information
benakansara authored Feb 9, 2023
1 parent 515eeab commit 959e238
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
7 changes: 0 additions & 7 deletions x-pack/plugins/infra/server/lib/alerting/common/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,6 @@ export const buildInvalidQueryAlertReason = (filterQueryText: string) =>
},
});

export const groupActionVariableDescription = i18n.translate(
'xpack.infra.metrics.alerting.groupActionVariableDescription',
{
defaultMessage: 'Name of the group reporting data',
}
);

export const groupByKeysActionVariableDescription = i18n.translate(
'xpack.infra.metrics.alerting.groupByKeysActionVariableDescription',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
alertStateActionVariableDescription,
cloudActionVariableDescription,
containerActionVariableDescription,
groupActionVariableDescription,
hostActionVariableDescription,
labelsActionVariableDescription,
metricActionVariableDescription,
Expand Down Expand Up @@ -75,6 +74,13 @@ const condition = schema.object({
),
});

const groupActionVariableDescription = i18n.translate(
'xpack.infra.inventory.alerting.groupActionVariableDescription',
{
defaultMessage: 'Name of the group reporting data',
}
);

export async function registerMetricInventoryThresholdRuleType(
alertingPlugin: PluginSetupContract,
libs: InfraBackendLibs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ const conditionsActionVariableDescription = i18n.translate(
const groupByActionVariableDescription = i18n.translate(
'xpack.infra.logs.alerting.threshold.groupByActionVariableDescription',
{
defaultMessage: 'The name of the group responsible for triggering the alert',
defaultMessage:
'The name of the group(s) responsible for triggering the alert. For accessing each group key, use context.groupByKeys.',
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
alertStateActionVariableDescription,
cloudActionVariableDescription,
containerActionVariableDescription,
groupActionVariableDescription,
groupByKeysActionVariableDescription,
hostActionVariableDescription,
labelsActionVariableDescription,
Expand Down Expand Up @@ -108,6 +107,14 @@ export async function registerMetricThresholdRuleType(
label: schema.maybe(schema.string()),
});

const groupActionVariableDescription = i18n.translate(
'xpack.infra.metrics.alerting.groupActionVariableDescription',
{
defaultMessage:
'Name of the group(s) reporting data. For accessing each group key, use context.groupByKeys.',
}
);

alertingPlugin.registerType({
id: METRIC_THRESHOLD_ALERT_TYPE_ID,
name: i18n.translate('xpack.infra.metrics.alertName', {
Expand Down

0 comments on commit 959e238

Please sign in to comment.