Skip to content

Commit

Permalink
[AWS] Move S3, SQS, SNS and lambda lightweight module config into int…
Browse files Browse the repository at this point in the history
…egration (#3838)
  • Loading branch information
kaiyan-sheng authored Jul 27, 2022
1 parent 999745e commit 5222ef6
Show file tree
Hide file tree
Showing 26 changed files with 767 additions and 373 deletions.
17 changes: 17 additions & 0 deletions packages/aws/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
# newer versions go on top
- version: "1.18.2"
changes:
- description: Move s3_request metrics config from beats to integrations
type: enhancement
link: https://github.com/elastic/integrations/pull/3838
- description: Move s3_daily_storage metrics config from beats to integrations
type: enhancement
link: https://github.com/elastic/integrations/pull/3838
- description: Move SQS metrics config from beats to integrations
type: enhancement
link: https://github.com/elastic/integrations/pull/3838
- description: Move SNS metrics config from beats to integrations
type: enhancement
link: https://github.com/elastic/integrations/pull/3838
- description: Move lambda metrics config from beats to integrations
type: enhancement
link: https://github.com/elastic/integrations/issues/3599
- version: "1.18.1"
changes:
- description: Release AWS billing integration as GA
Expand Down
30 changes: 28 additions & 2 deletions packages/aws/data_stream/lambda/agent/stream/stream.yml.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metricsets: ["lambda"]
metricsets: ["cloudwatch"]
period: {{period}}
{{#if access_key_id}}
access_key_id: {{access_key_id}}
Expand Down Expand Up @@ -35,4 +35,30 @@ tags_filter: {{tags_filter}}
{{/if}}
{{#if proxy_url }}
proxy_url: {{proxy_url}}
{{/if}}
{{/if}}
metrics:
- namespace: AWS/Lambda
resource_type: lambda
statistic: ["Average"]
name:
- Invocations
- Errors
- DeadLetterErrors
- DestinationDeliveryFailures
- Duration
- Throttles
- IteratorAge
- ConcurrentExecutions
- UnreservedConcurrentExecutions
- namespace: AWS/Lambda
resource_type: lambda
statistic: ["Maximum"]
name:
- ProvisionedConcurrentExecutions
- ProvisionedConcurrencyUtilization
- namespace: AWS/Lambda
resource_type: lambda
statistic: ["Sum"]
name:
- ProvisionedConcurrencyInvocations
- ProvisionedConcurrencySpilloverInvocations
4 changes: 0 additions & 4 deletions packages/aws/data_stream/lambda/fields/package-fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@
type: object
description: |
Metric dimensions.
- name: '*.metrics.*.*'
type: object
description: |
Metrics that returned from Cloudwatch API query.
76 changes: 45 additions & 31 deletions packages/aws/data_stream/lambda/sample_event.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,72 @@
{
"@timestamp": "2020-05-28T17:17:08.666Z",
"@timestamp": "2022-07-19T22:40:00.000Z",
"agent": {
"ephemeral_id": "17803f33-b617-4ce9-a9ac-e218c02aeb4b",
"id": "12f376ef-5186-4e8b-a175-70f1140a8f30",
"name": "MacBook-Elastic.local",
"name": "docker-fleet-agent",
"id": "2d4b09d0-cdb6-445e-ac3f-6415f87b9864",
"type": "metricbeat",
"version": "8.0.0"
"ephemeral_id": "ed2abfa1-df5e-4c3e-9c2b-143edcc0e111",
"version": "8.3.2"
},
"event": {
"dataset": "aws.lambda",
"module": "aws",
"duration": 10266182336
"elastic_agent": {
"id": "2d4b09d0-cdb6-445e-ac3f-6415f87b9864",
"version": "8.3.2",
"snapshot": false
},
"cloud": {
"provider": "aws",
"region": "eu-central-1",
"account": {
"name": "elastic-observability",
"id": "627286350134"
}
},
"ecs": {
"version": "8.0.0"
},
"service": {
"type": "aws"
},
"ecs": {
"version": "1.5.0"
"data_stream": {
"namespace": "default",
"type": "metrics",
"dataset": "aws.lambda"
},
"cloud": {
"account": {
"name": "elastic-beats",
"id": "428152502467"
},
"provider": "aws",
"region": "eu-central-1"
"metricset": {
"period": 300000,
"name": "cloudwatch"
},
"aws": {
"cloudwatch": {
"namespace": "AWS/Lambda"
},
"dimensions": {
"FunctionName": "ec2-owner-tagger-serverless",
"Resource": "ec2-owner-tagger-serverless"
},
"lambda": {
"metrics": {
"Duration": {
"avg": 8218.073333333334
},
"Errors": {
"avg": 0
},
"ConcurrentExecutions": {
"avg": 1
},
"Invocations": {
"avg": 1
},
"UnreservedConcurrentExecutions": {
"avg": 1
},
"Duration": {
"avg": 130.97
},
"Throttles": {
"avg": 0
}
}
},
"cloudwatch": {
"namespace": "AWS/Lambda"
}
},
"metricset": {
"name": "dynamodb",
"period": 300000
"event": {
"duration": 11364562400,
"agent_id_status": "verified",
"ingested": "2022-07-26T22:40:40Z",
"module": "aws",
"dataset": "aws.lambda"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metricsets: ["s3_daily_storage"]
metricsets: ["cloudwatch"]
period: {{period}}
{{#if access_key_id}}
access_key_id: {{access_key_id}}
Expand Down Expand Up @@ -32,4 +32,10 @@ latency: {{latency}}
{{/if}}
{{#if proxy_url }}
proxy_url: {{proxy_url}}
{{/if}}
{{/if}}
metrics:
- namespace: AWS/S3
statistic: ["Average"]
name:
- BucketSizeBytes
- NumberOfObjects
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
description: "Pipeline for S3 daily storage metrics"

processors:
- rename:
field: aws.s3.metrics.NumberOfObjects.avg
target_field: aws.s3_daily_storage.number_of_objects
ignore_missing: true
- rename:
field: aws.s3.metrics.BucketSizeBytes.avg
target_field: aws.s3_daily_storage.bucket.size.bytes
ignore_missing: true
- rename:
field: aws.dimensions.BucketName
target_field: aws.s3.bucket.name
ignore_missing: true
- remove:
field:
- aws.s3.metrics
ignore_missing: true
6 changes: 6 additions & 0 deletions packages/aws/data_stream/s3_daily_storage/fields/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@
type: long
description: |
The total number of objects stored in a bucket for all storage classes.
- name: cloudwatch
type: group
fields:
- name: namespace
type: keyword
description: The namespace specified when query cloudwatch api.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@
type: object
description: |
Metric dimensions.
- name: '*.metrics.*.*'
type: object
description: |
Metrics that returned from Cloudwatch API query.
73 changes: 45 additions & 28 deletions packages/aws/data_stream/s3_daily_storage/sample_event.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,65 @@
{
"@timestamp": "2020-05-28T17:58:27.154Z",
"@timestamp": "2022-07-25T19:02:00.000Z",
"agent": {
"name": "docker-fleet-agent",
"id": "2d4b09d0-cdb6-445e-ac3f-6415f87b9864",
"ephemeral_id": "9ef87976-bec2-4a74-9876-4e76d42035bb",
"type": "metricbeat",
"version": "8.3.2"
},
"elastic_agent": {
"id": "2d4b09d0-cdb6-445e-ac3f-6415f87b9864",
"version": "8.3.2",
"snapshot": false
},
"cloud": {
"provider": "aws",
"region": "eu-central-1",
"account": {
"name": "elastic-beats",
"id": "428152502467"
}
},
"ecs": {
"version": "8.0.0"
},
"service": {
"type": "aws"
},
"ecs": {
"version": "1.5.0"
"data_stream": {
"namespace": "default",
"type": "metrics",
"dataset": "aws.s3_daily_storage"
},
"metricset": {
"period": 86400000,
"name": "cloudwatch"
},
"aws": {
"s3": {
"bucket": {
"name": "test-s3-ks-2"
"name": "filebeat-aws-elb-test"
}
},
"cloudwatch": {
"namespace": "AWS/S3"
},
"s3_daily_storage": {
"bucket": {
"size": {
"bytes": 207372
"bytes": 469407687
}
},
"number_of_objects": 128
}
},
"dimensions": {
"StorageType": "StandardStorage"
}
},
"event": {
"dataset": "aws.s3_daily_storage",
"duration": 9553539400,
"agent_id_status": "verified",
"ingested": "2022-07-26T19:02:17Z",
"module": "aws",
"duration": 10418157072
},
"metricset": {
"period": 60000,
"name": "s3_daily_storage"
},
"cloud": {
"region": "us-west-2",
"account": {
"name": "elastic-beats",
"id": "428152502467"
},
"provider": "aws"
},
"agent": {
"version": "8.0.0",
"ephemeral_id": "17803f33-b617-4ce9-a9ac-e218c02aeb4b",
"id": "12f376ef-5186-4e8b-a175-70f1140a8f30",
"name": "MacBook-Elastic.local",
"type": "metricbeat"
"dataset": "aws.s3_daily_storage"
}
}
24 changes: 22 additions & 2 deletions packages/aws/data_stream/s3_request/agent/stream/stream.yml.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metricsets: ["s3_request"]
metricsets: ["cloudwatch"]
period: {{period}}
{{#if access_key_id}}
access_key_id: {{access_key_id}}
Expand Down Expand Up @@ -32,4 +32,24 @@ latency: {{latency}}
{{/if}}
{{#if proxy_url }}
proxy_url: {{proxy_url}}
{{/if}}
{{/if}}
metrics:
- namespace: AWS/S3
statistic: ["Average"]
name:
- AllRequests
- GetRequests
- PutRequests
- DeleteRequests
- HeadRequests
- PostRequests
- SelectRequests
- SelectScannedBytes
- SelectReturnedBytes
- ListRequests
- BytesDownloaded
- BytesUploaded
- 4xxErrors
- 5xxErrors
- FirstByteLatency
- TotalRequestLatency
Loading

0 comments on commit 5222ef6

Please sign in to comment.