cloudwatch metrics: expression warning too simplistic
See original GitHub issueDescribe the bug
CDK displays a warning for metrics expressions that are valid.
Specifically, it is trying to check that all variables used in the expression are defined, bit it does not deal with the SEARCH function, and likely not the METRICS either.
Expected Behavior
Not display a warning for valid expressions.
Current Behavior
Warning at /realtime-chime-meeting-local-997654549727-us-east-1-rjongbloed/Mon/Dash] Math expression '100 * SEARCH('{AWS/ApiGateway,ApiName,Method,Resource,Stage} ApiName=my-api MetricName=("4XXError" OR "5XXError")', 'Average', 60)' references unknown identifiers: piGateway, piName, ethod, esource, tage, piName, realtime, chime, meeting, local, rjongbloed, etricName, rror, rror, verage. Please add them to the 'usingMetrics' map.
Reproduction Steps
Create a metric using SEARCH function.
Possible Solution
- Parse the complex expression including functions, quotes, parentheses etc.
- Don’t do the check if the expression has “SEARCH” or “METRICS” in it.
- Remove the warning completely.
Additional Information/Context
No response
CDK CLI Version
2.22.0 (build 1db4b16)
Framework Version
1.153.1
Node.js Version
v16.15.0
OS
MacOS
Language
Typescript, Python
Language Version
No response
Other information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:17
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Using metric math - Amazon CloudWatch
Function Arguments Return type* Supported for cross‑account?
ABS TS. TS TS. TS ✓
ANOMALY_DETECTION_BAND TS. TS, S TS
AVG TS. TS S. TS ✓
Read more >CloudWatch Metric Math: Tutorial With Examples - OpsRamp
AWS CloudWatch is a monitoring tool that collects the data from the utilization of the Instances like EMR, EC2, etc., in the form...
Read more >Math Expression on AWS Cloudwatch metrics is not giving ...
I have created two metrics (m1 and m2) on my logs which will give me sum of some filter pattern, I wanted to...
Read more >CloudWatch — Boto3 Docs 1.26.37 documentation
For all other expressions and metrics, set ReturnData to false . ... If ignore , the alarm state does not change during periods...
Read more >AWS CloudWatch alerts vs. Dashbird alerts
Alerts will perform single or multiple actions based on the value of metric or expression which is relative to a threshold over a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would revert this feature, TBH. Its implementation did not take into account some scenarios.
Hi, I see this issue has been assigned and the priority increased, but May 2022 was the last update. Is there a rough ETA for when this might be picked up?