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): Unit.NONE does not mean "No unit" #20112

Closed
kyhau opened this issue Apr 27, 2022 · 2 comments · Fixed by #20249
Closed

(cloudwatch): Unit.NONE does not mean "No unit" #20112

kyhau opened this issue Apr 27, 2022 · 2 comments · Fixed by #20249
Labels
documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2 package/tools Related to AWS CDK Tools or CLI

Comments

@kyhau
Copy link

kyhau commented Apr 27, 2022

Describe the bug

In CDK it states Unit.NONE means "No unit", but it results in "None" instead of "No unit" (and no data is returned when Unit == None) .

Expected Behavior

The documentation states Unit.NONE means "No unit", so it is expected that when using Unit.NONE in CDK stack for alarm, the unit will be "No unit".

Current Behavior

In CDK it states Unit.NONE means "No unit"

image

The following screenshot shows the deployed alarm having Unit "None" instead of "No unit" (and no data is returned when Unit == None).

image

Reproduction Steps

  1. Use Unit.NONE for an alarm.
  2. Deploy the CDK stack.
  3. Check the alarm, you will see the Unit is None, not No Unit.

Possible Solution

Either fixed the documentation Unit.NONE != No Unit, or make Unit.NoUnit an option.

Additional Information/Context

No response

CDK CLI Version

2.21.1 (build a6ee543)

Framework Version

No response

Node.js Version

v16.14.2

OS

Ubuntu 20.04.4

Language

Typescript

Language Version

Version 4.6.3

Other information

No response

@kyhau kyhau added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 27, 2022
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Apr 27, 2022
@ryparker ryparker added p1 effort/small Small work item – less than a day of effort labels Apr 28, 2022
@kaizencc kaizencc changed the title aws-cdk-lib/aws-cloudwatch/metric-types: Unit.NONE does not mean "No unit" (cloudwatch): Unit.NONE does not mean "No unit" Apr 28, 2022
@kaizencc kaizencc added documentation This is a problem with documentation. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 28, 2022
@kaizencc
Copy link
Contributor

Hi @kyhau! I agree that the documentation for Unit.NONE is misleading. And while I see "no unit" is an option on the console screenshot you shared, I don't see that as an option under "unit" in the API reference. Don't think we'd be able to add that option if it's not part of the api reference, but we should change the documentation to avoid misunderstanding.

@kaizencc kaizencc added good first issue Related to contributions. See CONTRIBUTING.md p2 and removed p1 labels Apr 28, 2022
@mergify mergify bot closed this as completed in #20249 May 12, 2022
mergify bot pushed a commit that referenced this issue May 12, 2022
Fixes #20112. Changes documentation for metric unit `NONE` in CloudWatch to avoid any confusions between `NONE` and `No unit`.

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [ ] Did you use `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*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

wphilipw pushed a commit to wphilipw/aws-cdk that referenced this issue May 23, 2022
…20249)

Fixes aws#20112. Changes documentation for metric unit `NONE` in CloudWatch to avoid any confusions between `NONE` and `No unit`.

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [ ] Did you use `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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants