-
Notifications
You must be signed in to change notification settings - Fork 39
Added support for more than 100 metrics #31
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! One comment.
if should_serialize: | ||
event_batches.append(json.dumps(body)) | ||
metric_pointers = [] | ||
body["_aws"]["CloudWatchMetrics"][0]["Metrics"] = metric_pointers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ever reset the body? If I'm reading this correctly, all JSON payloads will contain all the metric values just not the pointers? For example, in the node implementation, we recreate a new body every time we flush: https://github.com/awslabs/aws-embedded-metrics-node/blob/730bbaeb341ee3952a404c04fc1de59a6ec65cf5/src/serializers/LogSerializer.ts#L71
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, JSON payload will contain the metric values. As per my understanding, We need to reset Metrics ( body["_aws"]["CloudWatchMetrics"][0]["Metrics"] ) and use the same value for other fields - Dimensions, Namespace, etc. Please correct me if am wrong.
Thanks,
Abdul
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to reset the body as well to prevent the payload from continuing to grow with metrics that aren't referenced. You're removing it from the pointers which is good, but not from the body which get added into ln54.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing it out. Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for doing this. Will bump the version, let it bake and release on Monday if everything looks good.
Issue #: #10
Description of changes:
Added support for more than 100 metrics
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.