-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(cloudwatch): allow overriding of metric graph rendering #4571
feat(cloudwatch): allow overriding of metric graph rendering #4571
Conversation
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
Please add a test
4721a17
to
f8368bf
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Aha yes. The change you are making breaks backwards compatibility:
The reason this is breaking is that someone somewhere in the world could be writing this piece of code: console.log(metric.toGraphConfig().period); And that code would break with the current state of this change. Please keep on generating the old properties, and mark them as |
f8368bf
to
02d1678
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
02d1678
to
8f26c2c
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Rebased on top of master. The build still fails because the old
|
Yeah, you can't really do that. Again, someone could be writing (in Java for example):
And that would now throw a Make it non-optional, mark it as Such are the burdens of API compatibility. |
This allows to create custom graphs easier by creating sub-class of metric and overriding the `toGraphConfig` method. Before attributes have been only selectively copied to the widget configuration. ``` class HiddenMetric extends Metric { public toGraphConfig(): any { const ret = super.toGraphConfig(); ret.renderingProperties.visible = false; } } ``` Before `visible` would not have been taken over since it was not part of options. Docs: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-Rendering-Object-Format
8f26c2c
to
672eb65
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
672eb65
to
f44d266
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This allows to create custom graphs easier by creating sub-class of
metric and overriding the
toGraphConfig
method. Before attributes havebeen only selectively copied to the widget configuration.
Before
visible
would not have been taken over since it was not part ofoptions.
Docs: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-Rendering-Object-Format
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license