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

[MetricBeat] support wildcard * dimension value in AWS CloudWatch module #19660

Merged
merged 4 commits into from
Jul 7, 2020

Conversation

kwinstonix
Copy link
Contributor

@kwinstonix kwinstonix commented Jul 5, 2020

  • Enhancement

What does this PR do?

  • support wildcard * dimension value in AWS CloudWatch metrics config
  • update document with example config

Why is it important?

Now we must set explicit dimension value to filter out CloudWatch metrics. It will be flexible if we can support wildcard * in value param.

current config example:

- module: aws
  period: 300s
  metricsets:
    - cloudwatch
  metrics:
    - namespace: AWS/ApplicationELB
      statistic: ['Maximum']
      name: ['UnHealthyHostCount']
      dimensions:
        - name: LoadBalancer
          value: "lb id"
        - name: TargetGroup
          value: "tg id"

with the enhancement:

- module: aws
  period: 300s
  metricsets:
    - cloudwatch
  metrics:
    - namespace: AWS/ApplicationELB
      statistic: ['Maximum']
      name: ['UnHealthyHostCount']
      dimensions:
        - name: LoadBalancer
          value: "*"
        - name: TargetGroup
          value: "*"

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.

Related issues

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

1 similar comment
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 5, 2020
@kwinstonix kwinstonix marked this pull request as ready for review July 5, 2020 08:58
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 5, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19660 updated]

  • Start Time: 2020-07-07T15:12:32.489+0000

  • Duration: 46 min 43 sec

Test stats 🧪

Test Results
Failed 0
Passed 729
Skipped 72
Total 801

Steps errors

Expand to view the steps failures

  • Name: Check out from version control
    • Description: [2020-07-07T15:14:14.724Z] using credential f6c7695a-671e-4f4f-a331-acdce44ff9ba
      [2020-07-07T15:14:

    • Duration: 2 min 13 sec

    • Start Time: 2020-07-07T15:14:12.141+0000

    • log

@kaiyan-sheng kaiyan-sheng self-assigned this Jul 5, 2020
@kaiyan-sheng kaiyan-sheng added needs_backport PR is waiting to be backported to other branches. review Team:Platforms Label for the Integrations - Platforms team labels Jul 5, 2020
@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 5, 2020
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

Tested and it works! Just one nit about adding a unit test for configDimensionValueContainsWildcard function. Thank you for the contribution!!

@kaiyan-sheng
Copy link
Contributor

jenkins run tests please

@kwinstonix
Copy link
Contributor Author

Ok, I will add that unit test, thank you

@kaiyan-sheng
Copy link
Contributor

jenkins run the tests

@kwinstonix
Copy link
Contributor Author

jenkins run the tests

@kaiyan-sheng
Copy link
Contributor

@kwinstonix Thank you! I just resolved the merge conflict and once the CI gives a green, I will merge this PR and backport it. Thanks again for your contribution!!

@kaiyan-sheng kaiyan-sheng merged commit ee4882c into elastic:master Jul 7, 2020
@kaiyan-sheng kaiyan-sheng removed the needs_backport PR is waiting to be backported to other branches. label Jul 7, 2020
kaiyan-sheng added a commit that referenced this pull request Jul 8, 2020
…n value in AWS CloudWatch module (#19714)

* [MetricBeat] support wildcard `*`  dimension value in AWS CloudWatch module (#19660)
(cherry picked from commit ee4882c)
Co-authored-by: martin <kwinstonix@users.noreply.github.com>
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
…odule (elastic#19660)

* dimension value could be wildcard `*`, it is more flexible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review Team:Platforms Label for the Integrations - Platforms team v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MetricBeat] AWS module support wildcard format dimension value to reduce the metrics count
4 participants