-
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.
Showing alerts as data in table with reason formatter for index thres…
…hold
- Loading branch information
Showing
22 changed files
with
566 additions
and
180 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* 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 { getHumanReadableComparator } from './comparator_types'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export function renderIndexThresholdParams(params: any) { | ||
const agg = params.aggField ? `${params.aggType}(${params.aggField})` : `${params.aggType}`; | ||
const conditions = `${agg} is ${getHumanReadableComparator( | ||
params.thresholdComparator | ||
)} ${params.threshold.join(' and ')}`; | ||
const window = `${params.timeWindowSize}${params.timeWindowUnit}`; | ||
return `${conditions} over ${window}`; | ||
} |
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
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
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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
36 changes: 36 additions & 0 deletions
36
x-pack/plugins/triggers_actions_ui/public/application/lib/alert_api/alert_data.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,36 @@ | ||
/* | ||
* 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 { HttpSetup } from 'kibana/public'; | ||
|
||
export interface AlertData { | ||
'rule.id': string; | ||
'kibana.rac.alert.value': number; | ||
'rule.name': string; | ||
'kibana.rac.alert.duration.us': number; | ||
'kibana.rac.alert.end': string; | ||
'kibana.rac.alert.threshold': number; | ||
'kibana.rac.alert.status': string; | ||
'kibana.rac.alert.uuid': string; | ||
'rule.uuid': string; | ||
'event.action': string; | ||
'@timestamp': string; | ||
'kibana.rac.alert.id': string; | ||
'kibana.rac.alert.start': string; | ||
'kibana.rac.producer': string; | ||
'event.kind': string; | ||
'rule.category': string; | ||
} | ||
|
||
export async function loadAlertData({ | ||
http, | ||
alertId, | ||
}: { | ||
http: HttpSetup; | ||
alertId: string; | ||
}): Promise<AlertData[]> { | ||
return await http.get(`/internal/stack_alerts/rule/${alertId}/_alert_data`); | ||
} |
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
139 changes: 0 additions & 139 deletions
139
...gers_actions_ui/public/application/sections/alert_details/components/alert_data_route.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.