This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Metrics UI] Add inventory metric threshold alerts (elastic#64292)
* Add new inventory metric threshold alert * Add missed file * Fix some types * Convert units on client and executor. * Move formatters to common. Properly format metrics in alert messages * Style changes * Remove unused files * fix test * Update create * Fix signature * Remove old test. Remove unecessary import * Pass in filter when clicking create alert from context menu * Fix filtering * Fix more types * Fix tests * Fix merge * Fix merge Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
Showing
58 changed files
with
1,995 additions
and
497 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
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
73 changes: 73 additions & 0 deletions
73
x-pack/plugins/infra/common/formatters/snapshot_metric_formats.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,73 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
enum InfraFormatterType { | ||
number = 'number', | ||
abbreviatedNumber = 'abbreviatedNumber', | ||
bytes = 'bytes', | ||
bits = 'bits', | ||
percent = 'percent', | ||
} | ||
|
||
interface MetricFormatter { | ||
formatter: InfraFormatterType; | ||
template: string; | ||
bounds?: { min: number; max: number }; | ||
} | ||
|
||
interface MetricFormatters { | ||
[key: string]: MetricFormatter; | ||
} | ||
|
||
export const METRIC_FORMATTERS: MetricFormatters = { | ||
['count']: { formatter: InfraFormatterType.number, template: '{{value}}' }, | ||
['cpu']: { | ||
formatter: InfraFormatterType.percent, | ||
template: '{{value}}', | ||
}, | ||
['memory']: { | ||
formatter: InfraFormatterType.percent, | ||
template: '{{value}}', | ||
}, | ||
['rx']: { formatter: InfraFormatterType.bits, template: '{{value}}/s' }, | ||
['tx']: { formatter: InfraFormatterType.bits, template: '{{value}}/s' }, | ||
['logRate']: { | ||
formatter: InfraFormatterType.abbreviatedNumber, | ||
template: '{{value}}/s', | ||
}, | ||
['diskIOReadBytes']: { | ||
formatter: InfraFormatterType.bytes, | ||
template: '{{value}}/s', | ||
}, | ||
['diskIOWriteBytes']: { | ||
formatter: InfraFormatterType.bytes, | ||
template: '{{value}}/s', | ||
}, | ||
['s3BucketSize']: { | ||
formatter: InfraFormatterType.bytes, | ||
template: '{{value}}', | ||
}, | ||
['s3TotalRequests']: { | ||
formatter: InfraFormatterType.abbreviatedNumber, | ||
template: '{{value}}', | ||
}, | ||
['s3NumberOfObjects']: { | ||
formatter: InfraFormatterType.abbreviatedNumber, | ||
template: '{{value}}', | ||
}, | ||
['s3UploadBytes']: { | ||
formatter: InfraFormatterType.bytes, | ||
template: '{{value}}', | ||
}, | ||
['s3DownloadBytes']: { | ||
formatter: InfraFormatterType.bytes, | ||
template: '{{value}}', | ||
}, | ||
['sqsOldestMessage']: { | ||
formatter: InfraFormatterType.number, | ||
template: '{{value}} seconds', | ||
}, | ||
}; |
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,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export enum InfraWaffleMapDataFormat { | ||
bytesDecimal = 'bytesDecimal', | ||
bitsDecimal = 'bitsDecimal', | ||
abbreviatedNumber = 'abbreviatedNumber', | ||
} |
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 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.