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.
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.
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
FAQs
How does it avoid filing the same alarm twice?
What happens if an alarm briefly blips and recovers on its own?
How is ticket priority decided?
Do I need PagerDuty or an SNS topic set up first?
Can I use Jira instead of Linear?
Related templates
Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.
Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.
Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.
On the first Monday of every month, find the alarms nobody watches and the monitoring you quietly pay for, then get a costed cleanup list in Slack and Linear.
Keep a spreadsheet of your most important senders, and every email from one gets labeled, posted to your team channel, and logged automatically.
The moment an order is fulfilled, we register it with Yotpo so the review request is timed off real delivery, and we log every sync so failures never go unnoticed.
Stop babysitting the CloudWatch console.
Let alarms flow into Linear, deduped and prioritized, so on-call only sees what actually needs a human.