-
Notifications
You must be signed in to change notification settings - Fork 37
fix: prevent putDimensions from storing duplicate dimensions #88
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is the Java-equivalent bug-fix for prior issue in Node: awslabs/aws-embedded-metrics-node#20 New conditions check for any matching dimension set before skipping put dimensions. This prevents duplicates from being stored. [TESTING] Unit test updated to address edge case; multiple dimension sets of variable size are added and checked. Ran integration tests using Docker and compared results in CloudWatch.
e47aa69
to
959d16e
Compare
… duplicate This change ensures new dimension key-values are used for the EMF root node by removing duplicate dimension sets and adding input dimension set to the end of the collection. Example: ``` [ { "keyA": "value1" }, { "keyA": "value2" }, ] // expected target member: { "keyA": "value2" } ``` [TESTING] Updated unit tests to check for this case wherein putDimensions may be triggered using various dimension set lengths, values, and order.
959d16e
to
d8c2d09
Compare
Ping, anyone at aws-embedded-metrics-java project with admin permissions can have a look at this PR? |
markkuhn
suggested changes
Aug 9, 2022
src/test/java/software/amazon/cloudwatchlogs/emf/model/MetricDirectiveTest.java
Outdated
Show resolved
Hide resolved
src/test/java/software/amazon/cloudwatchlogs/emf/model/MetricDirectiveTest.java
Outdated
Show resolved
Hide resolved
Stephen-Bao
approved these changes
Aug 11, 2022
markkuhn
approved these changes
Aug 15, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
#35 (related)
Description of changes
This is the Java-equivalent bug-fix for prior issue in Node:
This change introduces the following behaviors:
#putDimensions
do not duplicatethat newer/latest dimension values are used by the root EMF node
Example:
Description of how you validated changes
Unit test updated to address edge case;
multiple dimension sets of variable size are added and checked.
Ran integration tests using Docker and compared results in CloudWatch.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.