Skip to content

fix(0204): alarm descriptions must fit CloudWatch's 1024-char limit - #229

Merged
karczuRF merged 1 commit into
developfrom
fix/0204_alarm-description-1024-limit
Aug 20, 2026
Merged

fix(0204): alarm descriptions must fit CloudWatch's 1024-char limit#229
karczuRF merged 1 commit into
developfrom
fix/0204_alarm-description-1024-limit

Conversation

@karczuRF

Copy link
Copy Markdown
Collaborator

What happened

The first production deploy of the 0204 alarms failed mid-flight. Three usd-stranded rungs carried ~1250-character descriptions; CloudWatch caps AlarmDescription at 1024, and rejected them after other alarms in the stack had already been created.

Why nothing caught it

check result
cdk synth ✅ rendered the over-long description happily
template validity ✅ valid CloudFormation
cdk diff ✅ expected 12 additions, 1 modification, 0 deletions
CI ✅ green
CloudWatch API rejected at deploy

The limit is enforced only by the service. This is the task's own acceptance-criterion lesson — verified by inducing the condition, not by reading the CDK — landing on the deploy itself.

Fixes

1. Descriptions shortened to ≤ 937 chars. ⚠️ The text that pushed them over was text the same day's investigation had falsified: the "MEASURED BASELINE … priced by 30 h of age" claim and the "check the TWO-HOP chain rather than assuming the sweep" instruction. Both hops were measured healthy while the leg was dark, so that guidance pointed a responder at a dead end. The rewrite names the real cause (the USDT pivot has never priced a _1m row), states the alarm stays latched until 0209 is fixed, and warns to verify on _1m rather than a coarse tier.

2. assertAlarmDescriptionsFitCloudWatch() runs at synth — walks the construct tree, throws with offending alarm names and lengths, and reads the resolved CloudFormation property so token-built descriptions are measured as CloudWatch will see them.

These alarms carry deliberately long runbook-style descriptions because an operator reading Slack at 03:00 has nothing else. That's worth keeping, which is precisely why the ceiling needs a guard rather than discipline.

Verification

  • Guard verified by inducing it: padding one description to 2533 chars fails synth naming all three alarms and lengths.
  • Restoring produces a template byte-identical to the verified-good synth.
  • 34 alarms, longest description 937, zero over the limit.

Refs: task 0204, and 0209 / 0212 for the condition the rewritten description now points at.

The first production deploy failed mid-flight. Three usd-stranded rungs
carried ~1250-character descriptions and CloudWatch rejected them after
other alarms in the stack had already been created.

Nothing local catches this. cdk synth renders an over-long description
happily, the template is valid CloudFormation, cdk diff showed the expected
12 additions and 0 deletions, and CI was green — the limit lives only in the
CloudWatch API. So the guard has to run at synth: a construct-tree walk that
throws with the offending alarm names and lengths, reading the resolved
property so token-built descriptions are measured as CloudWatch sees them.

The descriptions are shortened to <= 937 chars, and the text that pushed
them over was text this same day falsified — the "priced by 30 h of age"
baseline and the "check the two-hop chain rather than assuming the sweep"
instruction. Both hops were measured healthy while the leg was dark, so that
guidance pointed a responder at a dead end. The rewrite names the real cause,
says the alarm stays latched until 0209 is fixed, and warns to verify on _1m
rather than a coarse tier.

Long runbook-style descriptions are worth keeping — an operator reading
Slack at 03:00 has nothing else — which is why this needs a guard rather
than discipline.

Guard verified by inducing it: padding a description to 2533 chars fails
synth with all three names; restoring yields a byte-identical template.
@karczuRF
karczuRF merged commit 4ad1ec9 into develop Aug 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant