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

Cherry-pick #17424 to 7.x: [Metricbeat] Fix cloudwatch metricset missing tags collection #17477

Merged
merged 1 commit into from
Apr 3, 2020
Merged

Cherry-pick #17424 to 7.x: [Metricbeat] Fix cloudwatch metricset missing tags collection #17477

merged 1 commit into from
Apr 3, 2020

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Apr 3, 2020

Cherry-pick of PR #17424 to 7.x branch. Original message:

What does this PR do?

This PR is to fix cloudwatch metricset from missing tags when tags.resource_type_filter is given. When user tries to collect daily storage metrics and s3 bucket tags with the cloudwatch metricset, it will fail to collect tags. This is because for CloudWatch metrics from S3 buckets, they always have StorageType as dimension. Dimension and S3 bucket name are combined to be the identifierValue in cloudwatch metricset code. But when collecting tags, dimension StorageType is not collected. That's why there is a mismatch between identifierValue and resourceTagMap.

Why is it important?

This PR will fix tags collection for all namespaces that always have a dimension reported in CloudWatch metrics.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  1. Make sure the AWS account you use for testing has S3 buckets with tags.
  2. Use config below for aws.yml:
- module: aws
  period: 86400s
  metricsets:
    - cloudwatch
  metrics:
    - namespace: AWS/S3
      tags.resource_type_filter: s3
  1. After starting Metricbeat, you should see tags collected from S3 buckets.

Related issues

* Fix cloudwatch metricset missing tags

(cherry picked from commit 68cdcf9)
@kaiyan-sheng kaiyan-sheng self-assigned this Apr 3, 2020
@kaiyan-sheng kaiyan-sheng added the Team:Platforms Label for the Integrations - Platforms team label Apr 3, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Looks good.

@kaiyan-sheng kaiyan-sheng merged commit 5be9071 into elastic:7.x Apr 3, 2020
@kaiyan-sheng kaiyan-sheng deleted the backport_17424_7.x branch April 3, 2020 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport review Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants