fourTheorem / slic-watch

Instant alarms and dashboards for Serverless, SAM, CDK and CloudFormation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lambda throttling alert has incorrect metric expression

konstantinasj-db opened this issue · comments

Describe the bug
When creating throttling alarms for Lambdas, incorrect math expression is used.
(throttles / throttles + invocations) * 100

To Reproduce
If we have 1 invocation and 0 throttles, result is (0 / 0 + 1) * 100 = Nan or 100 and as a result, alarm is triggered.

Expected behavior
Correct expression should be:
(throttles / (throttles + invocations)) * 100

Screenshots, Input Files and Logs
image

Environment:

  • Plugin version: 2.1.2

Additional context
Would be happy to contribute as this seems like a trivial fix.

Closed by #109 - thanks @konstantinasj-db 🎉
The fix is released in version 2.1.3 on NPM and the Serverless Application Repository