-
Notifications
You must be signed in to change notification settings - Fork 522
[AWS] Add dot_expander processor into metrics ingest pipeline #10683
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 all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
13c6557
Add dot_expander processor into metrics ingest pipeline
kaiyan-sheng b95362e
add changelog
kaiyan-sheng 04293a1
Merge remote-tracking branch 'upstream/main' into dot_expander
kaiyan-sheng 0de5abb
add pipeline tests
kaiyan-sheng f780f76
copy cloud.account.id to cloud.account.name
kaiyan-sheng cbd927a
change ec2 and rds test file to dotted fields
kaiyan-sheng 475beda
Change painless script to set processor
kaiyan-sheng cb7b24e
Merge remote-tracking branch 'upstream/main' into dot_expander
kaiyan-sheng a55f356
Add processor to set cloud.account.name field for aws_bedrock runtime…
kaiyan-sheng 4dffb71
add changelog
kaiyan-sheng 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
8 changes: 8 additions & 0 deletions
8
packages/aws/data_stream/billing/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
16 changes: 16 additions & 0 deletions
16
packages/aws/data_stream/dynamodb/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,16 @@ | ||
| --- | ||
| description: "Pipeline for DynamoDB metrics" | ||
|
|
||
| processors: | ||
| - dot_expander: | ||
| field: "*" | ||
| ignore_failure: true | ||
| - set: | ||
| field: cloud.account.name | ||
| copy_from: cloud.account.id | ||
| override: false | ||
| ignore_empty_value: true | ||
| on_failure: | ||
| - set: | ||
| field: 'error.message' | ||
| value: '{{ _ingest.on_failure_message }}' | ||
171 changes: 171 additions & 0 deletions
171
packages/aws/data_stream/ec2_metrics/_dev/test/pipeline/test-ec2-metrics-from-agent.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,171 @@ | ||
| { | ||
| "events": [ | ||
| { | ||
| "@timestamp": "2024-08-06T22:00:00.000Z", | ||
| "aws": { | ||
| "cloudwatch": { | ||
| "namespace": "AWS/EC2" | ||
| }, | ||
| "dimensions": { | ||
| "InstanceId": "i-006d0b31a9f91d631" | ||
| }, | ||
| "ec2": { | ||
| "instance": { | ||
| "core": { | ||
| "count": 2 | ||
| }, | ||
| "image": { | ||
| "id": "ami-03378d7af46c58f4c" | ||
| }, | ||
| "monitoring": { | ||
| "state": "disabled" | ||
| }, | ||
| "private": { | ||
| "dns_name": "ip-192-168-89-166.us-west-1.compute.internal", | ||
| "ip": "192.168.89.166" | ||
| }, | ||
| "public": { | ||
| "dns_name": "" | ||
| }, | ||
| "state": { | ||
| "code": 16, | ||
| "name": "running" | ||
| }, | ||
| "threads_per_core": 2 | ||
| }, | ||
| "metrics": { | ||
| "CPUCreditBalance": { | ||
| "avg": 0 | ||
| }, | ||
| "CPUCreditUsage": { | ||
| "avg": 7 | ||
| }, | ||
| "CPUSurplusCreditBalance": { | ||
| "avg": 2303 | ||
| }, | ||
| "CPUSurplusCreditsCharged": { | ||
| "avg": 0 | ||
| }, | ||
| "CPUUtilization": { | ||
| "avg": 42 | ||
| }, | ||
| "NetworkIn": { | ||
| "rate": 264934, | ||
| "sum": 79480460 | ||
| }, | ||
| "NetworkOut": { | ||
| "rate": 22565, | ||
| "sum": 6769654 | ||
| }, | ||
| "NetworkPacketsIn": { | ||
| "rate": 79, | ||
| "sum": 23747 | ||
| }, | ||
| "NetworkPacketsOut": { | ||
| "rate": 65, | ||
| "sum": 19516 | ||
| }, | ||
| "StatusCheckFailed": { | ||
| "avg": 0 | ||
| }, | ||
| "StatusCheckFailed_Instance": { | ||
| "avg": 0 | ||
| }, | ||
| "StatusCheckFailed_System": { | ||
| "avg": 0 | ||
| } | ||
| } | ||
| }, | ||
| "tags": { | ||
| "Name": "eks-obs-otel-demo-ng-2", | ||
| "aws:autoscaling:groupName": "eks-obs-otel-demo-ng-12c5a254-b280-1e48-35ff-1425abda72cf", | ||
| "aws:ec2:fleet-id": "fleet-9585078e-96b7-c916-0432-8428c5491787", | ||
| "aws:ec2launchtemplate:id": "lt-0505b33c1cff57ca8", | ||
| "aws:ec2launchtemplate:version": "1", | ||
| "aws:eks:cluster-name": "obs-otel-demo", | ||
| "division": "marketing", | ||
| "eks:cluster-name": "obs-otel-demo", | ||
| "eks:nodegroup-name": "obs-otel-demo-ng", | ||
| "k8s_io/cluster-autoscaler/enabled": "true", | ||
| "k8s_io/cluster-autoscaler/obs-otel-demo": "owned", | ||
| "kubernetes_io/cluster/obs-otel-demo": "owned", | ||
| "org": "obs", | ||
| "project": "aws-infra-env", | ||
| "team": "pmm" | ||
| } | ||
| }, | ||
| "cloud": { | ||
| "account": { | ||
| "id": "627286350134", | ||
| "name": "MonitoringAccount" | ||
| }, | ||
| "availability_zone": "us-west-1a", | ||
| "instance": { | ||
| "id": "i-006d0b31a9f91d631", | ||
| "name": "eks-obs-otel-demo-ng-2" | ||
| }, | ||
| "machine": { | ||
| "type": "t3.xlarge" | ||
| }, | ||
| "provider": "aws", | ||
| "region": "us-west-1" | ||
| }, | ||
| "data_stream": { | ||
| "dataset": "aws.ec2_metrics", | ||
| "namespace": "default", | ||
| "type": "metrics" | ||
| }, | ||
| "ecs": { | ||
| "version": "8.0.0" | ||
| }, | ||
| "elastic_agent": { | ||
| "id": "ed7d17c0-6cfe-46c6-b342-3972f1767bf9", | ||
| "snapshot": false, | ||
| "version": "8.14.0" | ||
| }, | ||
| "event": { | ||
| "agent_id_status": "verified", | ||
| "dataset": "aws.ec2_metrics", | ||
| "duration": 28201123846, | ||
| "ingested": "2024-08-06T22:16:22Z", | ||
| "module": "aws" | ||
| }, | ||
| "host": { | ||
| "architecture": "aarch64", | ||
| "containerized": false, | ||
| "cpu": { | ||
| "usage": 0.421 | ||
| }, | ||
| "hostname": "docker-fleet-agent", | ||
| "id": "5fc8920aefde4bfab8571da89c1e8835", | ||
| "name": "docker-fleet-agent", | ||
| "network": { | ||
| "egress": { | ||
| "bytes": 6769654, | ||
| "packets": 19516 | ||
| }, | ||
| "ingress": { | ||
| "bytes": 79480460, | ||
| "packets": 23747 | ||
| } | ||
| }, | ||
| "os": { | ||
| "codename": "focal", | ||
| "family": "debian", | ||
| "kernel": "6.10.0-linuxkit", | ||
| "name": "Ubuntu", | ||
| "platform": "ubuntu", | ||
| "type": "linux", | ||
| "version": "20.04.6 LTS (Focal Fossa)" | ||
| } | ||
| }, | ||
| "metricset": { | ||
| "name": "cloudwatch", | ||
| "period": 300000 | ||
| }, | ||
| "service": { | ||
| "type": "aws" | ||
| } | ||
| } | ||
| ] | ||
| } |
171 changes: 171 additions & 0 deletions
171
...data_stream/ec2_metrics/_dev/test/pipeline/test-ec2-metrics-from-agent.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,171 @@ | ||
| { | ||
| "expected": [ | ||
| { | ||
| "@timestamp": "2024-08-06T22:00:00.000Z", | ||
| "aws": { | ||
| "cloudwatch": { | ||
| "namespace": "AWS/EC2" | ||
| }, | ||
| "dimensions": { | ||
| "InstanceId": "i-006d0b31a9f91d631" | ||
| }, | ||
| "ec2": { | ||
| "instance": { | ||
| "core": { | ||
| "count": 2 | ||
| }, | ||
| "image": { | ||
| "id": "ami-03378d7af46c58f4c" | ||
| }, | ||
| "monitoring": { | ||
| "state": "disabled" | ||
| }, | ||
| "private": { | ||
| "dns_name": "ip-192-168-89-166.us-west-1.compute.internal", | ||
| "ip": "192.168.89.166" | ||
| }, | ||
| "public": { | ||
| "dns_name": "" | ||
| }, | ||
| "state": { | ||
| "code": 16, | ||
| "name": "running" | ||
| }, | ||
| "threads_per_core": 2 | ||
| }, | ||
| "metrics": { | ||
| "CPUCreditBalance": { | ||
| "avg": 0 | ||
| }, | ||
| "CPUCreditUsage": { | ||
| "avg": 7 | ||
| }, | ||
| "CPUSurplusCreditBalance": { | ||
| "avg": 2303 | ||
| }, | ||
| "CPUSurplusCreditsCharged": { | ||
| "avg": 0 | ||
| }, | ||
| "CPUUtilization": { | ||
| "avg": 42 | ||
| }, | ||
| "NetworkIn": { | ||
| "rate": 264934, | ||
| "sum": 79480460 | ||
| }, | ||
| "NetworkOut": { | ||
| "rate": 22565, | ||
| "sum": 6769654 | ||
| }, | ||
| "NetworkPacketsIn": { | ||
| "rate": 79, | ||
| "sum": 23747 | ||
| }, | ||
| "NetworkPacketsOut": { | ||
| "rate": 65, | ||
| "sum": 19516 | ||
| }, | ||
| "StatusCheckFailed": { | ||
| "avg": 0 | ||
| }, | ||
| "StatusCheckFailed_Instance": { | ||
| "avg": 0 | ||
| }, | ||
| "StatusCheckFailed_System": { | ||
| "avg": 0 | ||
| } | ||
| } | ||
| }, | ||
| "tags": { | ||
| "Name": "eks-obs-otel-demo-ng-2", | ||
| "aws:autoscaling:groupName": "eks-obs-otel-demo-ng-12c5a254-b280-1e48-35ff-1425abda72cf", | ||
| "aws:ec2:fleet-id": "fleet-9585078e-96b7-c916-0432-8428c5491787", | ||
| "aws:ec2launchtemplate:id": "lt-0505b33c1cff57ca8", | ||
| "aws:ec2launchtemplate:version": "1", | ||
| "aws:eks:cluster-name": "obs-otel-demo", | ||
| "division": "marketing", | ||
| "eks:cluster-name": "obs-otel-demo", | ||
| "eks:nodegroup-name": "obs-otel-demo-ng", | ||
| "k8s_io/cluster-autoscaler/enabled": "true", | ||
| "k8s_io/cluster-autoscaler/obs-otel-demo": "owned", | ||
| "kubernetes_io/cluster/obs-otel-demo": "owned", | ||
| "org": "obs", | ||
| "project": "aws-infra-env", | ||
| "team": "pmm" | ||
| } | ||
| }, | ||
| "cloud": { | ||
| "account": { | ||
| "id": "627286350134", | ||
| "name": "MonitoringAccount" | ||
| }, | ||
| "availability_zone": "us-west-1a", | ||
| "instance": { | ||
| "id": "i-006d0b31a9f91d631", | ||
| "name": "eks-obs-otel-demo-ng-2" | ||
| }, | ||
| "machine": { | ||
| "type": "t3.xlarge" | ||
| }, | ||
| "provider": "aws", | ||
| "region": "us-west-1" | ||
| }, | ||
| "data_stream": { | ||
| "dataset": "aws.ec2_metrics", | ||
| "namespace": "default", | ||
| "type": "metrics" | ||
| }, | ||
| "ecs": { | ||
| "version": "8.0.0" | ||
| }, | ||
| "elastic_agent": { | ||
| "id": "ed7d17c0-6cfe-46c6-b342-3972f1767bf9", | ||
| "snapshot": false, | ||
| "version": "8.14.0" | ||
| }, | ||
| "event": { | ||
| "agent_id_status": "verified", | ||
| "dataset": "aws.ec2_metrics", | ||
| "duration": 28201123846, | ||
| "ingested": "2024-08-06T22:16:22Z", | ||
| "module": "aws" | ||
| }, | ||
| "host": { | ||
| "architecture": "aarch64", | ||
| "containerized": false, | ||
| "cpu": { | ||
| "usage": 0.421 | ||
| }, | ||
| "hostname": "docker-fleet-agent", | ||
| "id": "5fc8920aefde4bfab8571da89c1e8835", | ||
| "name": "docker-fleet-agent", | ||
| "network": { | ||
| "egress": { | ||
| "bytes": 6769654, | ||
| "packets": 19516 | ||
| }, | ||
| "ingress": { | ||
| "bytes": 79480460, | ||
| "packets": 23747 | ||
| } | ||
| }, | ||
| "os": { | ||
| "codename": "focal", | ||
| "family": "debian", | ||
| "kernel": "6.10.0-linuxkit", | ||
| "name": "Ubuntu", | ||
| "platform": "ubuntu", | ||
| "type": "linux", | ||
| "version": "20.04.6 LTS (Focal Fossa)" | ||
| } | ||
| }, | ||
| "metricset": { | ||
| "name": "cloudwatch", | ||
| "period": 300000 | ||
| }, | ||
| "service": { | ||
| "type": "aws" | ||
| } | ||
| } | ||
| ] | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below is the extract from the sample events and here
cloud.account.nameandcloud.account.idare completely different values.So, why are we copying it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we seeing a situation when we have
cloud.account.idavailable but notcloud.account.name?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agithomas Yes! The account name is only available for metrics from elastic-agent/metricbeat. When metrics are collected from firehose, this field will always be empty which breaks the dashboards. This
copyshould only happen when account name is not available and should not overwrite.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agithomas I also added the set processor for cloud.account.name into aws_bedrock as you preferred. Thanks!