-
Notifications
You must be signed in to change notification settings - Fork 607
[awsfirehose] Add routing rules for metrics ingested from Firehose #9916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d7fc0d8
Add routing rules for metrics ingested from Firehose
c296c9d
add changelog
f94d0cf
Fix routing rule for s3 namespace
0d63db5
Remove set cloud.provider processor
4d52850
use subojbects: false for aws.dimensions.*
b77e03d
change format_version
0483d01
add dimension: true
f6cbc02
fix elastic-package check
53e685d
event.original is not needed for metrics
1ad257a
use ecs@mappings for awsfirehose package
8c660c4
change package description to add metrics support
94be9a6
update ecs.version
dc69ca6
Add documentation
b0cab48
only keep dimension:true fields in ecs.yml
64cf10a
Merge remote-tracking branch 'upstream/main' into reroute_metrics
7f3616d
fix doc and add data_stream fields back into ECS
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
24 changes: 24 additions & 0 deletions
24
packages/awsfirehose/data_stream/metrics/_dev/test/pipeline/test-apigateway-metric.json
This file contains hidden or 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,24 @@ | ||
| { | ||
| "events": [{ | ||
| "@timestamp":"2024-05-01T08:24:00Z", | ||
| "start_timestamp":"2024-05-01T08:23:00Z", | ||
| "agent.type":"firehose", | ||
| "cloud.provider":"aws", | ||
| "cloud.account.id":"12345678901", | ||
| "cloud.region":"ap-southeast-2", | ||
| "aws.exporter.arn":"arn:aws:cloudwatch:ap-southeast-2:12345678901:metric-stream/test-firehose-metrics", | ||
| "aws.cloudwatch.namespace":"AWS/ApiGateway", | ||
| "aws.dimensions":{ | ||
| "ApiId": "6am7mj7jqx" | ||
| }, | ||
| "aws.apigateway.metrics.4XXError":{ | ||
| "count":1, | ||
| "sum":0.0, | ||
| "min":0.0, | ||
| "max":0.0 | ||
| }, | ||
| "data_stream.type":"metrics", | ||
| "data_stream.dataset":"aws.cloudwatch", | ||
| "data_stream.namespace":"default" | ||
| }] | ||
| } |
32 changes: 32 additions & 0 deletions
32
...firehose/data_stream/metrics/_dev/test/pipeline/test-apigateway-metric.json-expected.json
This file contains hidden or 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 @@ | ||
| { | ||
| "expected": [ | ||
| { | ||
| "@timestamp": "2024-05-01T08:24:00Z", | ||
| "agent.type": "firehose", | ||
| "aws.apigateway.metrics.4XXError": { | ||
| "count": 1, | ||
| "max": 0.0, | ||
| "min": 0.0, | ||
| "sum": 0.0 | ||
| }, | ||
| "aws.cloudwatch.namespace": "AWS/ApiGateway", | ||
| "aws.dimensions": { | ||
| "ApiId": "6am7mj7jqx" | ||
| }, | ||
| "aws.exporter.arn": "arn:aws:cloudwatch:ap-southeast-2:12345678901:metric-stream/test-firehose-metrics", | ||
| "cloud": { | ||
| "provider": "aws" | ||
| }, | ||
| "cloud.account.id": "12345678901", | ||
| "cloud.provider": "aws", | ||
| "cloud.region": "ap-southeast-2", | ||
| "data_stream.dataset": "aws.apigateway_metrics", | ||
| "data_stream.namespace": "default", | ||
| "data_stream.type": "metrics", | ||
| "ecs": { | ||
| "version": "8.0.0" | ||
| }, | ||
| "start_timestamp": "2024-05-01T08:23:00Z" | ||
| } | ||
| ] | ||
| } |
48 changes: 48 additions & 0 deletions
48
...ges/awsfirehose/data_stream/metrics/_dev/test/pipeline/test-s3-daily-storage-metrics.json
This file contains hidden or 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,48 @@ | ||
| { | ||
| "events": [ | ||
| { | ||
| "@timestamp":"2024-04-30T08:23:00Z", | ||
| "start_timestamp":"2024-05-01T08:23:00Z", | ||
| "agent.type":"firehose", | ||
| "cloud.provider":"aws", | ||
| "cloud.account.id":"123456789012", | ||
| "cloud.region":"us-east-1", | ||
| "aws.exporter.arn":"arn:aws:cloudwatch:us-east-1:123456789012:metric-stream/test-s3", | ||
| "aws.cloudwatch.namespace":"AWS/S3", | ||
| "aws.dimensions":{ | ||
| "StorageType":"StandardStorage" | ||
| }, | ||
| "aws.s3.metrics.BucketSizeBytes":{ | ||
| "count":1, | ||
| "sum":76353832, | ||
| "min":76353832, | ||
| "max":76353832 | ||
| }, | ||
| "data_stream.type":"metrics", | ||
| "data_stream.dataset":"aws.cloudwatch", | ||
| "data_stream.namespace":"default" | ||
| }, | ||
| { | ||
| "@timestamp":"2024-04-30T08:23:00Z", | ||
| "start_timestamp":"2024-05-01T08:23:00Z", | ||
| "agent.type":"firehose", | ||
| "cloud.provider":"aws", | ||
| "cloud.account.id":"123456789012", | ||
| "cloud.region":"us-east-1", | ||
| "aws.exporter.arn":"arn:aws:cloudwatch:us-east-1:123456789012:metric-stream/test-s3", | ||
| "aws.cloudwatch.namespace":"AWS/S3", | ||
| "aws.dimensions":{ | ||
| "StorageType":"StandardStorage" | ||
| }, | ||
| "aws.s3.metrics.NumberOfObjects":{ | ||
| "count":1, | ||
| "sum":5, | ||
| "min":5, | ||
| "max":5 | ||
| }, | ||
| "data_stream.type":"metrics", | ||
| "data_stream.dataset":"aws.cloudwatch", | ||
| "data_stream.namespace":"default" | ||
| } | ||
| ] | ||
| } |
60 changes: 60 additions & 0 deletions
60
...e/data_stream/metrics/_dev/test/pipeline/test-s3-daily-storage-metrics.json-expected.json
This file contains hidden or 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,60 @@ | ||
| { | ||
| "expected": [ | ||
| { | ||
| "@timestamp": "2024-04-30T08:23:00Z", | ||
| "agent.type": "firehose", | ||
| "aws.cloudwatch.namespace": "AWS/S3", | ||
| "aws.dimensions": { | ||
| "StorageType": "StandardStorage" | ||
| }, | ||
| "aws.exporter.arn": "arn:aws:cloudwatch:us-east-1:123456789012:metric-stream/test-s3", | ||
| "aws.s3.metrics.BucketSizeBytes": { | ||
| "count": 1, | ||
| "max": 76353832, | ||
| "min": 76353832, | ||
| "sum": 76353832 | ||
| }, | ||
| "cloud": { | ||
| "provider": "aws" | ||
| }, | ||
| "cloud.account.id": "123456789012", | ||
| "cloud.provider": "aws", | ||
| "cloud.region": "us-east-1", | ||
| "data_stream.dataset": "aws.s3_daily_storage", | ||
| "data_stream.namespace": "default", | ||
| "data_stream.type": "metrics", | ||
| "ecs": { | ||
| "version": "8.0.0" | ||
| }, | ||
| "start_timestamp": "2024-05-01T08:23:00Z" | ||
| }, | ||
| { | ||
| "@timestamp": "2024-04-30T08:23:00Z", | ||
| "agent.type": "firehose", | ||
| "aws.cloudwatch.namespace": "AWS/S3", | ||
| "aws.dimensions": { | ||
| "StorageType": "StandardStorage" | ||
| }, | ||
| "aws.exporter.arn": "arn:aws:cloudwatch:us-east-1:123456789012:metric-stream/test-s3", | ||
| "aws.s3.metrics.NumberOfObjects": { | ||
| "count": 1, | ||
| "max": 5, | ||
| "min": 5, | ||
| "sum": 5 | ||
| }, | ||
| "cloud": { | ||
| "provider": "aws" | ||
| }, | ||
| "cloud.account.id": "123456789012", | ||
| "cloud.provider": "aws", | ||
| "cloud.region": "us-east-1", | ||
| "data_stream.dataset": "aws.s3_daily_storage", | ||
| "data_stream.namespace": "default", | ||
| "data_stream.type": "metrics", | ||
| "ecs": { | ||
| "version": "8.0.0" | ||
| }, | ||
| "start_timestamp": "2024-05-01T08:23:00Z" | ||
| } | ||
| ] | ||
| } |
27 changes: 27 additions & 0 deletions
27
packages/awsfirehose/data_stream/metrics/_dev/test/pipeline/test-s3-request-metrics.json
This file contains hidden or 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 @@ | ||
| { | ||
| "events": [ | ||
| { | ||
| "@timestamp": "2024-05-01T08:24:00Z", | ||
| "start_timestamp": "2024-05-01T08:23:00Z", | ||
| "agent.type": "firehose", | ||
| "cloud.provider": "aws", | ||
| "cloud.account.id": "123456789012", | ||
| "cloud.region": "us-east-1", | ||
| "aws.exporter.arn": "arn:aws:cloudwatch:us-east-1:123456789012:metric-stream/test-s3", | ||
| "aws.cloudwatch.namespace": "AWS/Firehose", | ||
| "aws.dimensions": { | ||
| "BucketName": "s3-bucket", | ||
| "StorageType": "StandardStorage" | ||
| }, | ||
| "aws.s3.metrics.AllRequests": { | ||
| "count": 1, | ||
| "sum": 30, | ||
| "min": 30, | ||
| "max": 30 | ||
| }, | ||
| "data_stream.type": "metrics", | ||
| "data_stream.dataset": "aws.cloudwatch", | ||
| "data_stream.namespace": "default" | ||
| } | ||
| ] | ||
| } |
33 changes: 33 additions & 0 deletions
33
...irehose/data_stream/metrics/_dev/test/pipeline/test-s3-request-metrics.json-expected.json
This file contains hidden or 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,33 @@ | ||
| { | ||
| "expected": [ | ||
| { | ||
| "@timestamp": "2024-05-01T08:24:00Z", | ||
| "agent.type": "firehose", | ||
| "aws.cloudwatch.namespace": "AWS/Firehose", | ||
| "aws.dimensions": { | ||
| "BucketName": "s3-bucket", | ||
| "StorageType": "StandardStorage" | ||
| }, | ||
| "aws.exporter.arn": "arn:aws:cloudwatch:us-east-1:123456789012:metric-stream/test-s3", | ||
| "aws.s3.metrics.AllRequests": { | ||
| "count": 1, | ||
| "max": 30, | ||
| "min": 30, | ||
| "sum": 30 | ||
| }, | ||
| "cloud": { | ||
| "provider": "aws" | ||
| }, | ||
| "cloud.account.id": "123456789012", | ||
| "cloud.provider": "aws", | ||
| "cloud.region": "us-east-1", | ||
| "data_stream.dataset": "aws.s3_request", | ||
| "data_stream.namespace": "default", | ||
| "data_stream.type": "metrics", | ||
| "ecs": { | ||
| "version": "8.0.0" | ||
| }, | ||
| "start_timestamp": "2024-05-01T08:23:00Z" | ||
| } | ||
| ] | ||
| } |
13 changes: 13 additions & 0 deletions
13
packages/awsfirehose/data_stream/metrics/elasticsearch/ingest_pipeline/default.yml
This file contains hidden or 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,13 @@ | ||
| --- | ||
| description: Pipeline for rerouting metrics stream from Amazon Data Firehose. | ||
| processors: | ||
| - set: | ||
| field: ecs.version | ||
| value: 8.0.0 | ||
| - set: | ||
| field: cloud.provider | ||
| value: aws | ||
| on_failure: | ||
| - set: | ||
| field: error.message | ||
| value: "{{ _ingest.on_failure_message }}" |
This file contains hidden or 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 @@ | ||
| - external: ecs | ||
| name: cloud.account.id | ||
| - external: ecs | ||
| name: cloud.provider | ||
| - external: ecs | ||
| name: cloud.region | ||
| - external: ecs | ||
| name: data_stream.type | ||
| - external: ecs | ||
| name: data_stream.dataset | ||
| - external: ecs | ||
| name: data_stream.namespace | ||
| - external: ecs | ||
| name: ecs.version | ||
| - external: ecs | ||
| name: error.message | ||
| - external: ecs | ||
| name: event.id | ||
| - external: ecs | ||
| name: event.original | ||
| - external: ecs | ||
| name: message | ||
| - external: ecs | ||
| name: '@timestamp' | ||
| - external: ecs | ||
| name: agent.type |
34 changes: 34 additions & 0 deletions
34
packages/awsfirehose/data_stream/metrics/fields/fields.yml
This file contains hidden or 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,34 @@ | ||
| - name: start_timestamp | ||
| type: date | ||
| description: Date/time when the monitoring cycle started. | ||
| - name: aws | ||
| type: group | ||
| fields: | ||
| - name: cloudwatch | ||
| type: group | ||
| fields: | ||
| - name: namespace | ||
| type: keyword | ||
| description: The namespace specified when query cloudwatch api. | ||
| - name: exporter | ||
| type: group | ||
| fields: | ||
| - name: arn | ||
| type: keyword | ||
| description: The metric stream ARN. | ||
| - name: dimensions | ||
| type: flattened | ||
| description: | | ||
| Metric dimensions. | ||
| - name: dimensions_fingerprint | ||
| type: keyword | ||
| description: | | ||
| Autogenerated ID representing the fingerprint of the aws.dimensions object. | ||
| dimension: true | ||
|
kaiyan-sheng marked this conversation as resolved.
Outdated
|
||
| - name: 'aws.*.metrics.*.*' | ||
| type: object | ||
| object_type: double | ||
| object_type_mapping_type: "*" | ||
| metric_type: gauge | ||
| description: | | ||
| Metrics that returned from Cloudwatch API query. | ||
This file contains hidden or 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,8 @@ | ||
| title: Metrics ingested from Amazon Data Firehose | ||
| type: metrics | ||
| dataset: awsfirehose | ||
| # This integration includes predefined rules that automatically route AWS service logs to the respective integrations. | ||
| # Adding these permissions to ensure the agents have permissions to write data to `metrics-*-*`. | ||
| elasticsearch: | ||
|
kaiyan-sheng marked this conversation as resolved.
Outdated
|
||
| dynamic_dataset: true | ||
| dynamic_namespace: true | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.