Turn CloudWatch alarms into Linear tickets

Every 15 minutes, scan CloudWatch for firing alarms and open a Linear ticket for each new one so on-call can start investigating without touching the AWS console.

Agentic Task
Amazon CloudWatchLinearGoogle SheetsEngineeringOperationsNotifications & AlertsResearch & Monitoring
PromptCreate

Every 15 minutes on a cron, sweep Amazon CloudWatch for any alarm that is currently in the ALARM state and turn each new one into a Linear issue in my engineering team, using a Google Sheets tab as the dedupe ledger so the same alarm never becomes two tickets.

Start the run by calling Amazon CloudWatch Describe Alarms with a state filter of ALARM to pull every alarm that is currently firing. For each alarm returned, capture the alarm ARN, alarm name, the metric or expression it is watching, its dimensions, the comparison operator and threshold, the current state reason, and the timestamp it entered the ALARM state.

Before doing anything with an alarm, open the Google Sheets ledger tab and check whether its ARN already appears in the ARN column. If it does, that alarm has already been ticketed on a previous run, so skip it. Only alarms not already in the ledger are candidates for a new ticket.

For each candidate alarm, call CloudWatch Describe Alarm History for that alarm scoped to the last hour or so, filtered to StateUpdate items, and read the sequence of state transitions. Use that history to make two judgement calls before writing a ticket.

First, flap suppression: if the alarm has flipped between OK and ALARM more than a couple of times in the last few minutes, or if it briefly self-resolved back to OK inside the last few minutes and has only just re-entered ALARM, treat it as a transient blip and do not open a ticket this cycle. The goal is that on-call is never paged for something that already fixed itself while the run was starting.

Second, priority: decide the Linear priority based on how long the alarm has been continuously in ALARM according to the state history. Something firing for under 15 minutes with a clean history is Low or Medium; an alarm that has been red continuously for 30+ minutes is High; an alarm red for over an hour with no self-recovery is Urgent. If the history looks flappy but the alarm is still firing, choose Medium and mention the flap pattern in the ticket so someone can tune the threshold.

Then call Linear Create Issue in my engineering team. The title should be the CloudWatch alarm name. The description should include the alarm ARN, the metric namespace and name, the full list of dimensions, the comparison operator and threshold value, the current state reason string from CloudWatch, when it first entered ALARM, and a short human summary of the last few state transitions from the history so the on-call engineer can start investigating without opening the AWS console. Set the priority you chose above.

Immediately after the ticket is created, call Google Sheets Append Values on the ledger tab and add a new row with three columns: the alarm ARN, the current timestamp in ISO 8601, and the URL of the Linear issue that was just created. This is what makes the next 15-minute run treat this alarm as already handled.

If Describe Alarms returns no firing alarms, or every firing alarm is either already in the ledger or classified as a flap, the run should exit quietly without opening any tickets or writing anything to the sheet.

Additional information

What does this prompt do?
  • Every 15 minutes we check Amazon CloudWatch for any alarm that is currently firing.
  • For each new alarm we open a Linear ticket in your engineering team with the alarm name, what it is watching, the threshold it breached, and a short summary of what just happened.
  • We keep a running ledger in a Google Sheets tab so the same alarm never becomes two tickets, even across restarts.
  • We skip alarms that already recovered on their own in the last few minutes and set ticket priority based on how long the alarm has been firing and whether it looks like a flap.
What do I need to use this?
  • An AWS account with CloudWatch alarms already configured in the region you want to watch
  • A Linear workspace with an engineering team where the tickets should land
  • A Google Sheet with an empty tab reserved for the dedupe ledger (one row per ticketed alarm)
How can I customize it?
  • Change how often we sweep — every 15 minutes by default, but nightly or every 5 minutes works too
  • Adjust the priority rules — for example, mark a ticket Urgent only after an alarm has been firing for 30 minutes straight
  • Narrow the scope — watch only alarms whose names start with a given prefix, or ignore alarms tagged as non-production

Frequently asked questions

How does it avoid filing the same alarm twice?
Before opening a ticket we look up the alarm in the Google Sheets ledger. If we already logged it, we skip. Right after a ticket is created we append a new row with the alarm identifier, the time, and the Linear ticket link so the next run treats it as handled.
What happens if an alarm briefly blips and recovers on its own?
We pull the recent state-change history for every firing alarm and, if it already flipped back to OK inside the last few minutes, we treat it as a flap and leave it alone. No ticket, no noise.
How is ticket priority decided?
The agent looks at how long the alarm has been continuously firing and how noisy its recent history looks. A brand-new alarm gets a lower priority than one that has been red for an hour, and something that keeps flipping states gets flagged as a probable flap for someone to tune.
Do I need PagerDuty or an SNS topic set up first?
No. This runs directly against the CloudWatch alarms API, so you do not need any paging integration wired up. Any alarm you can see in the AWS console is in scope.
Can I use Jira instead of Linear?
Yes — the same pattern works with a Jira ticket instead of a Linear issue. Just swap the ticketing step when you set the workflow up.

Stop babysitting the CloudWatch console.

Let alarms flow into Linear, deduped and prioritized, so on-call only sees what actually needs a human.