Skip to content
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

[AWS][EC2] Add processors to rename and drop fields #5812

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/aws/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.34.0"
changes:
- description: Add processors to sync EC2 fields with the metricbeat version.
type: enhancement
link: https://github.com/elastic/integrations/pull/5812
- version: "1.33.0"
changes:
- description: Add latency configuration option on the CloudWatch Logs integration.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
description: Pipeline for processing EC2 metrics
processors:
- rename:
ignore_missing: true
field: aws.ec2.metrics.CPUCreditUsage.avg
target_field: aws.ec2.cpu.credit_usage

- rename:
ignore_missing: true
field: aws.ec2.metrics.CPUCreditBalance.avg
target_field: aws.ec2.cpu.credit_balance

- rename:
ignore_missing: true
field: aws.ec2.metrics.CPUSurplusCreditBalance.avg
target_field: aws.ec2.cpu.surplus_credit_balance

- rename:
ignore_missing: true
field: aws.ec2.metrics.CPUSurplusCreditsCharged.avg
target_field: aws.ec2.cpu.surplus_credits_charged

- rename:
ignore_missing: true
field: aws.ec2.metrics.StatusCheckFailed.avg
target_field: aws.ec2.status.check_failed

- rename:
ignore_missing: true
field: aws.ec2.metrics.StatusCheckFailed_Instance.avg
target_field: aws.ec2.status.check_failed_instance

- rename:
ignore_missing: true
field: aws.ec2.metrics.StatusCheckFailed_System.avg
target_field: aws.ec2.status.check_failed_system

- rename:
ignore_missing: true
field: aws.ec2.metrics.NetworkIn.rate
target_field: aws.ec2.network.in.bytes_per_sec

- rename:
ignore_missing: true
field: aws.ec2.metrics.NetworkOut.rate
target_field: aws.ec2.network.out.bytes_per_sec

- rename:
ignore_missing: true
field: aws.ec2.metrics.NetworkPacketsIn.rate
target_field: aws.ec2.network.in.packets_per_sec

- rename:
ignore_missing: true
field: aws.ec2.metrics.NetworkPacketsOut.rate
target_field: aws.ec2.network.out.packets_per_sec

- rename:
ignore_missing: true
field: aws.ec2.metrics.DiskReadBytes.rate
target_field: aws.ec2.diskio.read.bytes_per_sec

- rename:
ignore_missing: true
field: aws.ec2.metrics.DiskWriteBytes.rate
target_field: aws.ec2.diskio.write.bytes_per_sec

- rename:
ignore_missing: true
field: aws.ec2.metrics.DiskReadOps.rate
target_field: aws.ec2.diskio.read.count_per_sec

- rename:
ignore_missing: true
field: aws.ec2.metrics.DiskWriteOps.rate
target_field: aws.ec2.diskio.write.count_per_sec

- remove:
ignore_missing: true
field:
- aws.ec2.metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think this could be considered a breaking change for customers who have potentially built dashboards on the existing (un-renamed) metrics fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, regarding the metrics.* maybe it is a breaking change, but it is not in sync with beats. And the documentation is not correct because the fields are mixed up. But maybe the best option is to support both for now. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeh it would avoid worrying about breaking things, but for all other customers means a bunch of duplication which sucks. @vinaychandrasekhar @SubhrataK what do you think? so long as the dashboards still work can we remove fields? the public documentation does mention the fields in the exported fields table, as shown below.

Screenshot 2023-04-12 at 11 33 21

@constanca-m i also added a pipeline test to validate whatever decision we make here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my two cents.

do you think this could be considered a breaking change for customers who have potentially built dashboards on the existing (un-renamed) metrics fields?

It might break the dashboards, but I do not think it should be considered a breaking change. Users have to explicitly upgrade the integration, no functionality breaks automatically. We had similar cases in the past (example).

In any case, we can consider bump the version to 1.5.0 or even 2.0.0 to signal the field naming change, if anything.

But maybe the best option is to support both for now. What do you think?

This is a possible option, but it would only delay the inevitable (e.g removing aws.ec2.metrics fields). I would opt for this only we are really on a tight schedule, to unblock this PR.

- aws.ec2.cpu.total.pct
- aws.ec2.diskio.read.bytes
- aws.ec2.diskio.read.count
- aws.ec2.diskio.write.bytes
- aws.ec2.diskio.write.count
- aws.ec2.network.in.bytes
- aws.ec2.network.in.packets
- aws.ec2.network.out.bytes
- aws.ec2.network.out.packets

on_failure:
- set:
field: 'error.message'
value: '{{ _ingest.on_failure_message }}'
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,3 @@
type: keyword
description: |
Name of a S3 bucket.
- name: dimensions.*
type: object
description: |
Metric dimensions.
- name: '*.metrics.*.*'
type: object
description: |
Metrics that returned from Cloudwatch API query.
2 changes: 0 additions & 2 deletions packages/aws/docs/ec2.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ An example event for `ec2` looks as following:
| Field | Description | Type |
|---|---|---|
| @timestamp | Event timestamp. | date |
| aws.\*.metrics.\*.\* | Metrics that returned from Cloudwatch API query. | object |
| aws.cloudwatch.namespace | The namespace specified when query cloudwatch api. | keyword |
| aws.dimensions.\* | Metric dimensions. | object |
| aws.dimensions.AutoScalingGroupName | An Auto Scaling group is a collection of instances you define if you're using Auto Scaling. | keyword |
| aws.dimensions.ImageId | This dimension filters the data you request for all instances running this Amazon EC2 Amazon Machine Image (AMI) | keyword |
| aws.dimensions.InstanceId | Amazon EC2 instance ID | keyword |
Expand Down
2 changes: 1 addition & 1 deletion packages/aws/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 1.0.0
name: aws
title: AWS
version: 1.33.0
version: 1.34.0
license: basic
description: Collect logs and metrics from Amazon Web Services with Elastic Agent.
type: integration
Expand Down