beats icon indicating copy to clipboard operation
beats copied to clipboard

[Metricbeat] Add Data Granularity config option for AWS Cloudwatch metrics

Open legoguy1000 opened this issue 3 years ago • 9 comments

…trics

What does this PR do?

Add Data Granularity config option for AWS Cloudwatch metrics

Why is it important?

Allows for fewer API calls with the same level of details in the metrics

Checklist

  • [X] My code follows the style guidelines of this project
  • [X] I have commented my code, particularly in hard-to-understand areas
  • [X] 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
  • [X] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

  • closes #33133

Use cases

Screenshots

Logs

legoguy1000 avatar Sep 22 '22 14:09 legoguy1000

@kaiyan-sheng let me know what u think??

legoguy1000 avatar Sep 22 '22 14:09 legoguy1000

This pull request does not have a backport label. If this is a bug or security fix, could you label this PR @legoguy1000? 🙏. For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

mergify[bot] avatar Sep 22 '22 14:09 mergify[bot]

:green_heart: Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-10-24T17:24:52.381+0000

  • Duration: 113 min 30 sec

Test stats :test_tube:

Test Results
Failed 0
Passed 4200
Skipped 1039
Total 5239

:green_heart: Flaky test report

Tests succeeded.

:robot: GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

elasticmachine avatar Sep 22 '22 14:09 elasticmachine

@legoguy1000 Thank you so much for adding this!! Quick question: (I have not tested this locally) Since with the data_granularity config, we are getting more data points, should timestamp := aws.FindTimestamp(metricDataResults) also be adjusted so we actually report all data points instead of only one?

kaiyan-sheng avatar Sep 22 '22 14:09 kaiyan-sheng

@legoguy1000 Thank you so much for adding this!! Quick question: (I have not tested this locally) Since with the data_granularity config, we are getting more data points, should timestamp := aws.FindTimestamp(metricDataResults) also be adjusted so we actually report all data points instead of only one?

I'd have to test it but after just looking at it, we'd have to iterate over the values list for each metrics and create an event for each one for each metrics with its associated timestamp. Is that what you're thinking?

legoguy1000 avatar Sep 22 '22 14:09 legoguy1000

@kaiyan-sheng Just updated. I don't even know if the FindTimestamp function is needed. The 2 loops within the function appear to return the same result so IDK why they are separated like that. Also with my change, i can only assume there will be a timestamp per value.

legoguy1000 avatar Sep 22 '22 15:09 legoguy1000

cc @ravikesarwani I think it would be good to have your input on the docs-related changes

girodav avatar Sep 23 '22 16:09 girodav

/test

girodav avatar Sep 30 '22 10:09 girodav

Thanks @legoguy1000 for adding this :) . I am currently keeping this PR on hold as we might have some refactoring to do, as follow-up of https://github.com/elastic/beats/pull/33105 (cc @kaiyan-sheng )

girodav avatar Oct 06 '22 13:10 girodav

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b 33133-cloudwatch-granularity upstream/33133-cloudwatch-granularity
git merge upstream/main
git push upstream 33133-cloudwatch-granularity

mergify[bot] avatar Oct 18 '22 12:10 mergify[bot]