Skip to content

Conversation

@abidhasan-aws
Copy link
Contributor

Issue # (if applicable)

Closes #19876

Reason for this change

Allows setting id and visible for Cloudwatch Metric

Description of changes

Add id and visible in Cloudwatch Metric

Describe any new or updated permissions being added

Description of how you validated changes

Add unit tests and integ test

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels Jul 1, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team July 1, 2025 15:05
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jul 1, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@aws-cdk-automation aws-cdk-automation dismissed their stale review July 2, 2025 08:58

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@abidhasan-aws abidhasan-aws marked this pull request as ready for review July 2, 2025 09:01
@ozelalisen
Copy link
Member

Build Log is failed. Could you fix it?

import { IntegTest } from '@aws-cdk/integ-tests-alpha';
import { Dashboard, Metric, GraphWidget } from 'aws-cdk-lib/aws-cloudwatch';

class DashboardWithMetricIdAndVisibleIntegrationTest extends Stack {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration test is good, but it doesn't demonstrate the primary use case of using the id property with math expressions as described in the issue. Improve the integration test to include a math expression that references metrics by their IDs, which would better validate the actual use case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made some changes to include usage of ID of predefined metrics inside math expression.

});
```

### Metric ID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't provide a complete example showing how to use the id property with math expressions, which is the primary use case mentioned in the issue. Expand the documentation to include a complete example showing how to use the id property with math expressions, similar to the use case described in the issue.

@ozelalisen ozelalisen changed the title feat(cloudwatch): add id and visible to metric class feat(cloudwatch): add id and visible properties for CloudWatch Metric Jul 3, 2025
"explanation": "Force lowercasing of RDS Cluster names in CDK"
},
"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": {
"recommendedValue": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem unrelated to me. Could you check why those fields are added?

"explanation": "Tighten default KMS key policies"
},
"@aws-cdk/aws-s3:grantWriteWithoutAcl": {
"recommendedValue": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here. Why this report is added here?

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: b0b5849
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Member

@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify
Copy link
Contributor

mergify bot commented Jul 3, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 879afd6 into aws:main Jul 3, 2025
19 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-cloudwatch): Allow setting id and visible properties for cloudwatch Metric

3 participants