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

Metric will not update CloudFormation for changed unit #4716

Closed
sbstjn opened this issue Oct 28, 2019 · 1 comment
Closed

Metric will not update CloudFormation for changed unit #4716

sbstjn opened this issue Oct 28, 2019 · 1 comment
Assignees
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch feature-request A feature should be added or improved.

Comments

@sbstjn
Copy link

sbstjn commented Oct 28, 2019

If you change a Metric unit in a CloudWatch Dashboard/Widget, the aws-cdk will not generate new CloudFormation resources when title is changed.

Reproduction Steps

First, deploy the dashboard with a widget and metric, then change the metric's unit and deploy again.

dashboard.addWidgets(
  new GraphWidget({
    title: 'A: B',
    width: 12,
    left: [
      new Metric({
        label: 'Duration',
        metricName: 'Duration',
        statistic: 'Average',
        // unit: Unit.MILLISECONDS,
        namespace: 'AWS/Lambda',
        dimensions: {
          FunctionName: foo.functionName
        }
      })
    ]
  })
)

Environment

  • CLI Version : 1.14.0
  • Framework Version: 1.14.0
  • OS :
  • Language : TypeScript

Other


This is 🐛 Bug Report

@sbstjn sbstjn added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 28, 2019
@nmussy
Copy link
Contributor

nmussy commented Oct 28, 2019

Hey @sbstjn,

You're not seeing any changes because the unit property isn't set. As you can see in the CloudWatch API Rerefernce, there is no corresponding key. I assume that the CloudWatch Dashboard just uses the reported metric unit.

We could create a new WidgetMetric type to prevent future confusion. Thoughts?

@SomayaB SomayaB added the @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch label Oct 28, 2019
@rix0rrr rix0rrr added feature-request A feature should be added or improved. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 29, 2019
@SomayaB SomayaB added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Nov 8, 2019
@SomayaB SomayaB removed their assignment Nov 8, 2019
@SomayaB SomayaB removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Nov 15, 2019
@rix0rrr rix0rrr closed this as completed in a7f189e Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

4 participants