aws / aws/aws-cdk

Set the yAxis of a metric in a widget

Open
#20,102 4 comments 2 reactions 0 assignees View on GitHub
@aws-cdk/aws-cloudwatch effort/small feature-request feature/coverage-gap feature/enhancement p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

I would like to be able to set the yAxis value of a metric using the CDK. As per https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html it's defined as:

```
yAxis
Where on the graph to display the y-axis for this metric. The default is left.

Valid Values: left | right

Type: String

Required: No
```

### Use Case

Without the ability to change the yAxis value of a metric I have to graph some metric math expressions on an entirely different graph to avoid conflicting units and scale. This is incredibly frustrating and results in a suboptimal dashboard.

### Proposed Solution

Add the ability to set the `yAxis` value for a metric. Similar to how we can already set `color` and `label`.

### Other Information

_No response_

### Acknowledgements

- [X] I may be able to implement this feature request
- [X] This feature might incur a breaking change

### CDK version used

1

### Environment details (OS name and version, etc.)

N/A

Contributor guide

Open the contributing guide

Research direction

Start by locating the CDK widget metric API that already exposes color and label, then compare its generated CloudWatch dashboard metric shape with the AWS Dashboard Body Structure reference. Done means callers can set yAxis to left or right on an individual metric and the value is emitted in the dashboard definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, observability-sre
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.