-
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): add verticalAnnotations property to GraphWidget #22568
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
f6ca465
to
2054e46
Compare
✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.
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.
Thank you for your contribution! This looks very close to being ready to go. Just a few comments inline.
/** | ||
* The date and time in the graph where the vertical annotation line is to appear | ||
*/ | ||
readonly value: string; |
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.
If this is supposed to be a timestamp, I think we should type it that way instead of as a string.
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.
Also, should this be called date
instead?
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.
done
@@ -413,6 +420,11 @@ export class GraphWidget extends ConcreteWidget { | |||
...(this.props.leftAnnotations || []).map(mapAnnotation('left')), | |||
...(this.props.rightAnnotations || []).map(mapAnnotation('right')), | |||
]; | |||
const verticalAnnotations = this.props.verticalAnnotations || []; |
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.
This line doesn't seem needed. When you check against verticalAnnotations.length
you could instead just check against this.props.verticalAnnotations?.length > 0
.
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.
that doesn't compile, and we are actually referencing verticalAnnotations
3 times so this seems cleaner
@@ -53,6 +53,13 @@ dashboard.addWidgets(new cloudwatch.GraphWidget({ | |||
title: 'More messages in queue with alarm annotation', | |||
left: [numberOfMessagesVisibleMetric], | |||
leftAnnotations: [alarm.toAnnotation()], | |||
verticalAnnotations: [ |
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.
I'd prefer to see a new test that includes these annotations instead of editing an existing test.
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.
may I ask why? that would involve a whole lot of boilerplate setting up a new test, this was trivial to add
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.
Because when we pile too much functionality into one test, it's harder to decipher if we're getting the output we're looking for and harder to troubleshoot when a test fails.
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.
Also, was this test run and deployed? If so, I'd expect to see changes to more than these two files. It appears that this was run with --dry-run
or that it was manually edited.
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
3 similar comments
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
2054e46
to
d759a24
Compare
Pull request has been modified.
d759a24
to
19dd676
Compare
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.
Back into changes requested for the integ test update I requested.
@@ -53,6 +53,13 @@ dashboard.addWidgets(new cloudwatch.GraphWidget({ | |||
title: 'More messages in queue with alarm annotation', | |||
left: [numberOfMessagesVisibleMetric], | |||
leftAnnotations: [alarm.toAnnotation()], | |||
verticalAnnotations: [ |
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.
Also, was this test run and deployed? If so, I'd expect to see changes to more than these two files. It appears that this was run with --dry-run
or that it was manually edited.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
Would be great to have vertical annotations in CDK widgets. |
Adds a
verticalAnnotation
property toGraphWidget
. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-Annotation-Format.Also see #7622
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license