// advent-of-postgres/day-12
The Noisy Alerts
Every team gets to silence its three noisiest alert rules. Rank the rules per team, not across the whole company.
Alert fatigue is real at the North Pole. The new policy: each team may silence its three noisiest alert rules for the rest of December. Sugarplum wants to know how many alerts that would have removed on 12 December.
Every alert that fired on 12 December (UTC) is in alerts, and nothing else is, so count every row:
| Column | Type | Notes |
|---|---|---|
id |
int |
Primary key |
team |
text |
The team that owns the rule |
rule |
text |
The alert rule that fired |
fired_at |
timestamptz |
When it fired |
A rule's noise is how many times it fired. If two rules of a team fired the same number of times, the one whose name comes first alphabetically ranks higher.
Your task
Take each team's three noisiest rules. How many alerts did those rules fire in total?
Submit the number.
Stuck? Show a hint
Count per team and rule first, then use row_number() OVER (PARTITION BY team ORDER BY count DESC, rule).
Download today's data as SQL to solve it on your own Postgres (14 or later).
Solved this puzzle? Share it.
Tag @thedevopsdaily and share it with the community.
We earn commissions when you shop through the links below.
Bitrise
Managed runners for GitHub Actions
Bitrise Build Hub runs your GitHub Actions jobs on M4 Macs and AMD Linux machines. Change runs-on and keep your workflows, secrets and logs on GitHub.
Atomsized
AWS platform engineering and GitOps
Design and automation for reliable AWS and Kubernetes platforms, safer delivery workflows, and preview and UAT environments your engineers can understand and own.
DigitalOcean
Cloud infrastructure for developers
Simple, reliable cloud computing designed for developers
DevDojo
Developer community & tools
Join a community of developers sharing knowledge and tools
SMTPfast
Developer-first email API
Send transactional and marketing email through a clean REST API. Detailed logs, webhooks, and embeddable signup forms in one dashboard.
QuizAPI
Developer-first quiz platform
Build, generate, and embed quizzes with a powerful REST API. AI-powered question generation and live multiplayer.
Want to support DevOps Daily and reach thousands of developers?
Become a Sponsor