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

cloudwatch: support bands in horizontal and vertical annotations #29070

Open
2 tasks
humanzz opened this issue Feb 11, 2024 · 2 comments
Open
2 tasks

cloudwatch: support bands in horizontal and vertical annotations #29070

humanzz opened this issue Feb 11, 2024 · 2 comments
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@humanzz
Copy link
Contributor

humanzz commented Feb 11, 2024

Describe the feature

Horizontal and Vertical annotations support declaring a band (from, to) as can be seen in Horizontal Annotations and Vertical Annotations sections in https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html

The current implementation assumes just a single value with an above/below before/after shading

Use Case

Showing bands in metrics widgets, and coloring cells in the yet-to-be-implemented table widget #28975

Proposed Solution

A likely nice implementation would've been to change HorizontalAnnotation and VerticalAnnotation to classes with factory methods and a toJson or render method.

This, however, would be a breaking change.

As such, I'm not sure what the best approach would be, I can think of some options

  1. Update the interfaces to have an additional field that captures the label and value of the other point in the range. This, however, will require widgets to check for that field, and render accordingly.
  2. introduce new classes, new props fields, to replace the existing ones while marking them as deprecated. The challenge with this would be in naming those classes/fields as the good names are already taken

Other Information

I might be able to contribute a change, if discussions here lead to an agreed on approach

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.125.0

Environment details (OS name and version, etc.)

macOS

@humanzz humanzz added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 11, 2024
@github-actions github-actions bot added the @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch label Feb 11, 2024
@humanzz
Copy link
Contributor Author

humanzz commented Feb 12, 2024

Having been working on #28975, I actually ended up introducing a new Threshold class for the new TableWidget in #29078.

This class is a long the lines of having new classes for HorizontalAnnotation and VerticalAnnotation

@pahud pahud added p2 effort/medium Medium work item – several days of effort labels Feb 13, 2024
@pahud
Copy link
Contributor

pahud commented Feb 13, 2024

Thanks for the use case sharing and proposed solutions. We welcome and appreciate any PRs for this.

@pahud pahud removed the needs-triage This issue or PR still needs to be triaged. label Feb 13, 2024
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 effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants