-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RAC] [Metrics UI] Register Inventory rule types with new RAC rules r…
…egistry (#105706) * WIP: register inventory metric threshold as lifecycle rule * fix inventory executor error * save alerts into ES * temp * basic format reason for inventory threshold * clean up, fix i18n error and temporarily remove types * delete serialized params * include group name in the reason * cleanup * link to default metrics page * grab the value and threshold for the inventory item * fix typo * fix check types * remove threshold and currentValue, the reason field will contain this info for combined conditions * remove thereshold and value from the reason, soon will be replaced by indexed reason field * remove unnecessary export Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
4c7037b
commit eaa6dcb
Showing
6 changed files
with
233 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
x-pack/plugins/infra/public/alerting/inventory/rule_data_formatters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
import { ALERT_ID } from '@kbn/rule-data-utils'; | ||
import { ObservabilityRuleTypeFormatter } from '../../../../observability/public'; | ||
|
||
export const formatReason: ObservabilityRuleTypeFormatter = ({ fields }) => { | ||
const groupName = fields[ALERT_ID]; | ||
const reason = i18n.translate('xpack.infra.metrics.alerting.inventory.alertReasonDescription', { | ||
defaultMessage: 'Inventory alert for {groupName}.', // TEMP reason message, will be deleted once we index the reason field | ||
values: { | ||
groupName, | ||
}, | ||
}); | ||
|
||
const link = '/app/metrics/inventory'; | ||
|
||
return { | ||
reason, | ||
link, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.