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

[7.17](backport #40135) [aws] Fix missing metrics bug when include_linked_accounts set to false #40139

Closed
wants to merge 3 commits into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 8, 2024

Proposed commit message

This PR is to fix a bug in cloudwatch metricbeat module when include_linked_accounts is false. Because where the wrongly put return, we are missing metrics in pagination. I also added a test for the case when there is more than one page of results from ListMetrics API.

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.

Disruptive User Impact

No disruptive user impact.

How to test this PR locally

  1. Setup your AWS account to have multiple RDS clusters and make sure we have metrics in CloudWatch.
  2. Start Metricbeat with aws.yml looks like this:
- module: aws
  period: 1m
  credential_profile_name: elastic-observability
  metricsets:
    - cloudwatch
  regions: eu-west-3
  latency: 10m
  include_linked_accounts: false
  metrics:
    - namespace: AWS/RDS
      name: ["CPUUtilization"]
      resource_type: rds
      statistic: ["Average"]

You should see metrics only being collected from 2 RDS clusters. But if you change the include_linked_accounts to true, then you will get metrics from all clusters (5 in this case).
3. Apply the changes from this PR and rebuild metricbeat locally. Run with the same aws.yml with include_linked_accounts equals to false and you should see metrics from all clusters now.
Screenshot 2024-07-08 at 12 04 59 AM

Related issues

…se (#40135)

(cherry picked from commit 8da898f)

# Conflicts:
#	x-pack/metricbeat/module/aws/utils.go
#	x-pack/metricbeat/module/aws/utils_test.go
@mergify mergify bot requested a review from a team as a code owner July 8, 2024 17:53
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Jul 8, 2024
Copy link
Contributor Author

mergify bot commented Jul 8, 2024

Cherry-pick of 8da898f has failed:

On branch mergify/bp/7.17/pr-40135
Your branch is up to date with 'origin/7.17'.

You are currently cherry-picking commit 8da898fb47.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   CHANGELOG.next.asciidoc

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   x-pack/metricbeat/module/aws/utils.go
	both modified:   x-pack/metricbeat/module/aws/utils_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 8, 2024
@botelastic
Copy link

botelastic bot commented Jul 8, 2024

This pull request doesn't have a Team:<team> label.

@kaiyan-sheng kaiyan-sheng deleted the mergify/bp/7.17/pr-40135 branch July 8, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant