Aws-cdk: cloudwatch: add support for Metric Math

Created on 5 Nov 2018  路  4Comments  路  Source: aws/aws-cdk

Most helpful comment

Hi, do you have any idea when this feature will be released?

All 4 comments

Hi, do you have any idea when this feature will be released?

If you happen to be someone who wants to use metric math but don't want to wait for it to release, I was able to use escape hatches to make an Alarm in CDK and get the metric math working.

Comments on my approach are also welcome

  1. I created a Metric object (you'll have to set a namespace and metricName but that can be deleted later
  2. I created an Alarm object (set metric to above metric, and evaluationPeriod and threshold are legitimate fields we'll fill out and use)
  3. Used addPropertyDeletionOverride on above Alarm object to delete MetricName, Dimensions, Period, Namespace, Statistic, and ExtendedStatistic fields
  4. Added a Metrics field on Alarm Object using addPropertyOverride. Use CloudFormation documentation to fill out the data in Metrics field as you would in a CFN template

Note that there are no escape hatches for Dashboards and Widgets so there appears to be no way to use Metric Math with CloudWatch Dashboards at this time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mirazmamun picture mirazmamun  路  3Comments

peterdeme picture peterdeme  路  3Comments

PaulMaddox picture PaulMaddox  路  3Comments

eladb picture eladb  路  3Comments

eladb picture eladb  路  3Comments