-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-cloudwatchRelated to Amazon CloudWatchRelated to Amazon CloudWatchbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2pr/needs-review
Description
Describe the bug
I have a metric expression defined as SUM(METRICS("prefix")) where some of my metrics contains the "prefix" string.
When I synthetize the CDK, I started getting warning like this:
[Warning at $SECRET Math expression 'SUM(METRICS("prefix"))' references unknown identifiers: prefix. Please add them to the 'usingMetrics' map. [ack: CloudWatch:Math:UnknownIdentifier]
However, those are false-positives and should be skipped in the following line:
| if (!this.expression.toUpperCase().match('\\s*INSIGHT_RULE_METRIC|SELECT|SEARCH|METRICS\\s.*') && missingIdentifiers.length > 0) { |
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
Given that the METRICS operation accept part identifier names, it should not produce any warnings.
Current Behavior
It produces warnings.
Reproduction Steps
Partially define a identifier in a SUM(METRICS("partial")) expression.
Possible Solution
Update regular expression to properly handle the keywords that skip the warning:
'\\b(INSIGHT_RULE_METRIC|SELECT|SEARCH|METRICS)\\b'
Additional Information/Context
No response
CDK CLI Version
2.173.4
Framework Version
No response
Node.js Version
18
OS
OS X
Language
TypeScript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-cloudwatchRelated to Amazon CloudWatchRelated to Amazon CloudWatchbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp2pr/needs-review