[Metricbeat] Add Data Granularity config option for AWS Cloudwatch metrics
…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.asciidocorCHANGELOG-developer.next.asciidoc.
Author's Checklist
- [ ]
How to test this PR locally
Related issues
- closes #33133
Use cases
Screenshots
Logs
@kaiyan-sheng let me know what u think??
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.0is the label to automatically backport to the8./dbranch./dis the digit
:green_heart: Build Succeeded
the below badges are clickable and redirect to their specific view in the CI or DOCS
![]()
![]()
![]()
![]()
![]()
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. -
runelasticsearch-ci/docs: Re-trigger the docs validation. (use unformatted text in the comment!)
@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?
@legoguy1000 Thank you so much for adding this!! Quick question: (I have not tested this locally) Since with the
data_granularityconfig, we are getting more data points, shouldtimestamp := 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?
@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.
cc @ravikesarwani I think it would be good to have your input on the docs-related changes
/test
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 )
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