-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf2a3bb
commit e0aef39
Showing
43 changed files
with
672 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,5 +31,6 @@ export const sharedSchema = gql` | |
container | ||
host | ||
awsEC2 | ||
awsS3 | ||
} | ||
`; |
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
26 changes: 26 additions & 0 deletions
26
x-pack/legacy/plugins/infra/common/inventory_models/aws_s3/index.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,26 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { metrics } from './metrics'; | ||
import { InventoryModel } from '../types'; | ||
|
||
export const awsS3: InventoryModel = { | ||
id: 'awsS3', | ||
displayName: 'S3', | ||
requiredModules: ['aws'], | ||
metrics, | ||
fields: { | ||
id: 'aws.s3.bucket.name', | ||
name: 'aws.s3.bucket.name', | ||
}, | ||
requiredMetrics: [ | ||
'awsS3BucketSize', | ||
'awsS3NumberOfObjects', | ||
'awsS3TotalRequests', | ||
'awsS3DownloadBytes', | ||
'awsS3UploadBytes', | ||
], | ||
}; |
143 changes: 143 additions & 0 deletions
143
x-pack/legacy/plugins/infra/common/inventory_models/aws_s3/layout.tsx
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,143 @@ | ||
/* | ||
* 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. | ||
*/ | ||
import React from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { LayoutPropsWithTheme } from '../../../public/pages/metrics/types'; | ||
import { Section } from '../../../public/pages/metrics/components/section'; | ||
import { SubSection } from '../../../public/pages/metrics/components/sub_section'; | ||
import { ChartSectionVis } from '../../../public/pages/metrics/components/chart_section_vis'; | ||
import { withTheme } from '../../../../../common/eui_styled_components'; | ||
|
||
export const Layout = withTheme(({ metrics, theme }: LayoutPropsWithTheme) => ( | ||
<React.Fragment> | ||
<Section | ||
navLabel="AWS S3" | ||
sectionLabel={i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.overviewSection.sectionLabel', | ||
{ | ||
defaultMessage: 'Aws S3 Overview', | ||
} | ||
)} | ||
metrics={metrics} | ||
> | ||
<SubSection | ||
id="awsS3BucketSize" | ||
label={i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.bucketSize.sectionLabel', | ||
{ | ||
defaultMessage: 'Bucket Size', | ||
} | ||
)} | ||
> | ||
<ChartSectionVis | ||
type="bar" | ||
formatter="bytes" | ||
seriesOverrides={{ | ||
bytes: { | ||
color: theme.eui.euiColorVis1, | ||
name: i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.bucketSize.chartLabel', | ||
{ defaultMessage: 'Total Bytes' } | ||
), | ||
}, | ||
}} | ||
/> | ||
</SubSection> | ||
<SubSection | ||
id="awsS3NumberOfObjects" | ||
label={i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.numberOfObjects.sectionLabel', | ||
{ | ||
defaultMessage: 'Number of Objects', | ||
} | ||
)} | ||
> | ||
<ChartSectionVis | ||
type="bar" | ||
formatter="abbreviatedNumber" | ||
seriesOverrides={{ | ||
objects: { | ||
color: theme.eui.euiColorVis1, | ||
name: i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.numberOfObjects.chartLabel', | ||
{ defaultMessage: 'Objects' } | ||
), | ||
}, | ||
}} | ||
/> | ||
</SubSection> | ||
<SubSection | ||
id="awsS3TotalRequests" | ||
label={i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.totalRequests.sectionLabel', | ||
{ | ||
defaultMessage: 'Total Requests', | ||
} | ||
)} | ||
> | ||
<ChartSectionVis | ||
type="bar" | ||
formatter="abbreviatedNumber" | ||
seriesOverrides={{ | ||
total: { | ||
color: theme.eui.euiColorVis1, | ||
name: i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.totalRequests.chartLabel', | ||
{ defaultMessage: 'Requests' } | ||
), | ||
}, | ||
}} | ||
/> | ||
</SubSection> | ||
<SubSection | ||
id="awsS3DownloadBytes" | ||
label={i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.downloadBytes.sectionLabel', | ||
{ | ||
defaultMessage: 'Downloaded Bytes', | ||
} | ||
)} | ||
> | ||
<ChartSectionVis | ||
type="bar" | ||
formatter="bytes" | ||
seriesOverrides={{ | ||
bytes: { | ||
color: theme.eui.euiColorVis1, | ||
name: i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.downloadBytes.chartLabel', | ||
{ defaultMessage: 'Bytes' } | ||
), | ||
}, | ||
}} | ||
/> | ||
</SubSection> | ||
<SubSection | ||
id="awsS3UploadBytes" | ||
label={i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.uploadBytes.sectionLabel', | ||
{ | ||
defaultMessage: 'Uploaded Bytes', | ||
} | ||
)} | ||
> | ||
<ChartSectionVis | ||
type="bar" | ||
formatter="bytes" | ||
seriesOverrides={{ | ||
bytes: { | ||
color: theme.eui.euiColorVis1, | ||
name: i18n.translate( | ||
'xpack.infra.metricDetailPage.s3MetricsLayout.uploadBytes.chartLabel', | ||
{ defaultMessage: 'Bytes' } | ||
), | ||
}, | ||
}} | ||
/> | ||
</SubSection> | ||
</Section> | ||
</React.Fragment> | ||
)); |
38 changes: 38 additions & 0 deletions
38
x-pack/legacy/plugins/infra/common/inventory_models/aws_s3/metrics/index.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,38 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { InventoryMetrics } from '../../types'; | ||
|
||
import { awsS3BucketSize } from './tsvb/aws_s3_bucket_size'; | ||
import { awsS3TotalRequests } from './tsvb/aws_s3_total_requests'; | ||
import { awsS3NumberOfObjects } from './tsvb/aws_s3_number_of_objects'; | ||
import { awsS3DownloadBytes } from './tsvb/aws_s3_download_bytes'; | ||
import { awsS3UploadBytes } from './tsvb/aws_s3_upload_bytes'; | ||
|
||
import { s3BucketSize } from './snapshot/s3_bucket_size'; | ||
import { s3TotalRequests } from './snapshot/s3_total_requests'; | ||
import { s3NumberOfObjects } from './snapshot/s3_number_of_objects'; | ||
import { s3DownloadBytes } from './snapshot/s3_download_bytes'; | ||
import { s3UploadBytes } from './snapshot/s3_upload_bytes'; | ||
|
||
export const metrics: InventoryMetrics = { | ||
tsvb: { | ||
awsS3BucketSize, | ||
awsS3TotalRequests, | ||
awsS3NumberOfObjects, | ||
awsS3DownloadBytes, | ||
awsS3UploadBytes, | ||
}, | ||
snapshot: { | ||
s3BucketSize, | ||
s3NumberOfObjects, | ||
s3TotalRequests, | ||
s3UploadBytes, | ||
s3DownloadBytes, | ||
}, | ||
defaultSnapshot: 's3BucketSize', | ||
defaultTimeRangeInSeconds: 86400 * 7, // 7 days | ||
}; |
15 changes: 15 additions & 0 deletions
15
...ck/legacy/plugins/infra/common/inventory_models/aws_s3/metrics/snapshot/s3_bucket_size.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,15 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { SnapshotModel } from '../../../types'; | ||
|
||
export const s3BucketSize: SnapshotModel = { | ||
s3BucketSize: { | ||
max: { | ||
field: 'aws.s3_daily_storage.bucket.size.bytes', | ||
}, | ||
}, | ||
}; |
15 changes: 15 additions & 0 deletions
15
...legacy/plugins/infra/common/inventory_models/aws_s3/metrics/snapshot/s3_download_bytes.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,15 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { SnapshotModel } from '../../../types'; | ||
|
||
export const s3DownloadBytes: SnapshotModel = { | ||
s3DownloadBytes: { | ||
max: { | ||
field: 'aws.s3_daily_storage.downloaded.bytes', | ||
}, | ||
}, | ||
}; |
15 changes: 15 additions & 0 deletions
15
...acy/plugins/infra/common/inventory_models/aws_s3/metrics/snapshot/s3_number_of_objects.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,15 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { SnapshotModel } from '../../../types'; | ||
|
||
export const s3NumberOfObjects: SnapshotModel = { | ||
s3NumberOfObjects: { | ||
max: { | ||
field: 'aws.s3_daily_storage.number_of_objects', | ||
}, | ||
}, | ||
}; |
15 changes: 15 additions & 0 deletions
15
...legacy/plugins/infra/common/inventory_models/aws_s3/metrics/snapshot/s3_total_requests.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,15 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { SnapshotModel } from '../../../types'; | ||
|
||
export const s3TotalRequests: SnapshotModel = { | ||
s3TotalRequests: { | ||
max: { | ||
field: 'aws.s3_daily_storage.requests.total', | ||
}, | ||
}, | ||
}; |
15 changes: 15 additions & 0 deletions
15
...k/legacy/plugins/infra/common/inventory_models/aws_s3/metrics/snapshot/s3_upload_bytes.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,15 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { SnapshotModel } from '../../../types'; | ||
|
||
export const s3UploadBytes: SnapshotModel = { | ||
s3UploadBytes: { | ||
max: { | ||
field: 'aws.s3_daily_storage.uploaded.bytes', | ||
}, | ||
}, | ||
}; |
32 changes: 32 additions & 0 deletions
32
...ck/legacy/plugins/infra/common/inventory_models/aws_s3/metrics/tsvb/aws_s3_bucket_size.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,32 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { TSVBMetricModelCreator, TSVBMetricModel } from '../../../types'; | ||
|
||
export const awsS3BucketSize: TSVBMetricModelCreator = ( | ||
timeField, | ||
indexPattern | ||
): TSVBMetricModel => ({ | ||
id: 'awsS3BucketSize', | ||
requires: ['aws.s3_daily_storage'], | ||
index_pattern: indexPattern, | ||
interval: '>=86400s', | ||
time_field: timeField, | ||
type: 'timeseries', | ||
series: [ | ||
{ | ||
id: 'bytes', | ||
split_mode: 'everything', | ||
metrics: [ | ||
{ | ||
field: 'aws.s3_daily_storage.bucket.size.bytes', | ||
id: 'max-bytes', | ||
type: 'max', | ||
}, | ||
], | ||
}, | ||
], | ||
}); |
Oops, something went wrong.