Add basic addition support to cloudwatch.get_metric_data expressions #8416
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.
I am writing some code that uses the Cloudwatch
GetMetricData
API's math expression feature, specifically in trying to add two metrics together.This PR adds support for adding two metrics together using the expression feature.
There are some additional features and validation I would like to add to this (specifically, checking that there aren't any other special characters, so that
m1 + m2 - m3
would fail, and the ability to add more than two metrics together, exm1 + m2 + m3
), but I wanted to open the PR at this point to see if this feature would be considered useful and check if this seems like a reasonable approach to the problem.