mirror of
https://github.com/Sea-Haven-Industries/procurement-ingest.git
synced 2026-09-30 06:03:14 +00:00
Fix WO fallback-rate alarm math expression (deploy hotfix) (#102)
Some checks are pending
Deploy / deploy (push) Waiting to run
Some checks are pending
Deploy / deploy (push) Waiting to run
The EmailProcessorTemplateFallbackRateAlarm added in #99 used MAX([FILL(fb,0)+FILL(tmpl,0),1]) as a divide-by-zero guard, but CloudWatch metric math has no element-wise MAX over an array; it rejects the array operand at deploy time with 'Unsupported operand type(s) for MAX', failing the WorkorderIngestStack update (it rolled back cleanly). The outer IF((...)>=10, ...) volume floor already guarantees a non-zero denominator in the true branch, so divide by (FILL(fb,0)+FILL(tmpl,0)) directly and drop the invalid guard. Unblocks the #99 deploy (PO stack already applied; WO rolled back).
This commit is contained in:
parent
acc1961d21
commit
8e16d34dc7
1 changed files with 5 additions and 1 deletions
|
|
@ -418,8 +418,12 @@ class WorkorderIngestStack(Stack):
|
|||
)
|
||||
fallback_rate = cloudwatch.MathExpression(
|
||||
expression=(
|
||||
# The IF volume floor (>=10) already guarantees the denominator
|
||||
# is non-zero in the true branch, so divide directly. (An earlier
|
||||
# MAX([...,1]) divide-by-zero guard used array syntax CloudWatch
|
||||
# rejects at deploy: "Unsupported operand type(s) for MAX".)
|
||||
"IF((FILL(fb,0)+FILL(tmpl,0))>=10, "
|
||||
"100*FILL(fb,0)/MAX([FILL(fb,0)+FILL(tmpl,0),1]), 0)"
|
||||
"100*FILL(fb,0)/(FILL(fb,0)+FILL(tmpl,0)), 0)"
|
||||
),
|
||||
using_metrics={"fb": fb_metric, "tmpl": tmpl_metric},
|
||||
period=Duration.minutes(15),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue