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

Fix aws cloudwatch event identifiers #34483

Merged
merged 7 commits into from
Feb 8, 2023
Merged

Fix aws cloudwatch event identifiers #34483

merged 7 commits into from
Feb 8, 2023

Conversation

aspacca
Copy link

@aspacca aspacca commented Feb 6, 2023

Bug

What does this PR do?

#33166 introduced support for granularity in cloudwatch metrics API calls.
we collect events identified by an ID: different metrics are merged in a single event according to the ID of the event
the mentioned PR refactored the way the ID was generated, introducing a bug that prevented different metrics to be merged in a single event.
changing the event ID also prevented the ec2 add metadata to match the metadata of an instance to a given event, losing the enrichment of an event with such metadata
we fix the ID generation, still suffixing it with the dimension of the given granularity, so that we are able to merge different metrics on the same event
we refactored the ID matching logic in the ec2 add metadata to ignore the granularity dimension suffix

Why is it important?

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.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@aspacca aspacca requested a review from a team as a code owner February 6, 2023 09:11
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 6, 2023
@aspacca aspacca requested a review from girodav February 6, 2023 09:11
@aspacca aspacca added the Team:Cloud-Monitoring Label for the Cloud Monitoring team label Feb 6, 2023
@aspacca aspacca self-assigned this Feb 6, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 6, 2023
@mergify
Copy link
Contributor

mergify bot commented Feb 6, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @aspacca? 🙏.
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

@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 6, 2023

💚 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: 2023-02-08T02:41:47.697+0000

  • Duration: 80 min 48 sec

Test stats 🧪

Test Results
Failed 0
Passed 1432
Skipped 110
Total 1542

💚 Flaky test report

Tests succeeded.

🤖 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!)

@aspacca
Copy link
Author

aspacca commented Feb 6, 2023

/test

@aspacca aspacca added the backport-v8.6.0 Automated backport with mergify label Feb 8, 2023
@aspacca aspacca merged commit 78c035e into elastic:main Feb 8, 2023
mergify bot pushed a commit that referenced this pull request Feb 8, 2023
* keep event identifier prefix as before introducing granularity

* fix ec2 add metadata to deal with new event identifier suffixed by granularity dimension

* fix tests

* fix comments

* strict instanceID check on ec2 metadata

* fix identifier matching on rds and sqs metadata

* changelog

(cherry picked from commit 78c035e)
aspacca pushed a commit that referenced this pull request Feb 8, 2023
* Fix aws cloudwatch event identifiers (#34483)

* keep event identifier prefix as before introducing granularity

* fix ec2 add metadata to deal with new event identifier suffixed by granularity dimension

* fix tests

* fix comments

* strict instanceID check on ec2 metadata

* fix identifier matching on rds and sqs metadata

* changelog

(cherry picked from commit 78c035e)

* fix backport conflict

* fix backport conflict

---------

Co-authored-by: Andrea Spacca <andrea.spacca@elastic.co>
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
* keep event identifier prefix as before introducing granularity

* fix ec2 add metadata to deal with new event identifier suffixed by granularity dimension

* fix tests

* fix comments

* strict instanceID check on ec2 metadata

* fix identifier matching on rds and sqs metadata

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.6.0 Automated backport with mergify Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants