Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,21 @@ export const apmRuleTypeAlertFieldMap = {
// Defines which alerts-as-data index alerts will use
export const ApmRuleTypeAlertDefinition: IRuleTypeAlerts<ObservabilityApmAlert> = {
context: APM_RULE_TYPE_ALERT_CONTEXT,
mappings: { fieldMap: apmRuleTypeAlertFieldMap },
mappings: {
fieldMap: apmRuleTypeAlertFieldMap,
dynamicTemplates: [
{
strings_as_keywords: {
path_match: 'kibana.alert.grouping.*',
match_mapping_type: 'string',
mapping: {
type: 'keyword',
ignore_above: 1024,
},
},
},
],
},
useLegacyAlerts: true,
shouldWrite: true,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
ALERT_EVALUATION_VALUE,
ALERT_REASON,
ALERT_RULE_PARAMETERS,
ALERT_GROUPING,
ApmRuleType,
} from '@kbn/rule-data-utils';
import type { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils';
Expand Down Expand Up @@ -251,6 +252,7 @@ export function registerErrorCountRuleType({
[ALERT_EVALUATION_THRESHOLD]: ruleParams.threshold,
[ERROR_GROUP_ID]: ruleParams.errorGroupingKey,
[ALERT_REASON]: alertReason,
[ALERT_GROUPING]: groupingObject,
...sourceFields,
...groupByFields,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
ALERT_EVALUATION_VALUE,
ALERT_REASON,
ALERT_RULE_PARAMETERS,
ALERT_GROUPING,
ApmRuleType,
} from '@kbn/rule-data-utils';
import type { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils';
Expand Down Expand Up @@ -321,6 +322,7 @@ export function registerTransactionDurationRuleType({
[ALERT_EVALUATION_VALUE]: transactionDuration,
[ALERT_EVALUATION_THRESHOLD]: thresholdMicroseconds,
[ALERT_REASON]: reason,
[ALERT_GROUPING]: groupingObject,
...sourceFields,
...groupByFields,
};
Expand Down Expand Up @@ -383,7 +385,7 @@ export function registerTransactionDurationRuleType({
threshold: ruleParams.threshold,
triggerValue: transactionDurationFormatted,
viewInAppUrl,
grouping: groupingObject,
grouping: alertHits?.[ALERT_GROUPING],
...groupByActionVariables,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
ALERT_EVALUATION_VALUE,
ALERT_REASON,
ALERT_RULE_PARAMETERS,
ALERT_GROUPING,
ApmRuleType,
} from '@kbn/rule-data-utils';
import type { ObservabilityApmAlert } from '@kbn/alerts-as-data-utils';
Expand Down Expand Up @@ -301,6 +302,7 @@ export function registerTransactionErrorRateRuleType({
[ALERT_EVALUATION_VALUE]: errorRate,
[ALERT_EVALUATION_THRESHOLD]: ruleParams.threshold,
[ALERT_REASON]: reasonMessage,
[ALERT_GROUPING]: groupingObject,
...sourceFields,
...groupByFields,
};
Expand Down Expand Up @@ -375,7 +377,7 @@ export function registerTransactionErrorRateRuleType({
threshold: ruleParams.threshold,
triggerValue: asDecimalOrInteger(alertHits?.[ALERT_EVALUATION_VALUE]),
viewInAppUrl,
grouping: groupingObject,
grouping: alertHits?.[ALERT_GROUPING],
...groupByActionVariables,
};

Expand Down