AWS CloudWatch monitors millions of EC2 instances. A common task is detecting "Hot-Spots"—servers that are pinned at high utilization for long periods, which might indicate a memory leak or a runaway process.
Write a query to identify servers where the cpu_utilization was strictly greater than 90% for 10 or more consecutive 1-minute logs.
| log_id(INTEGER) | server_id(INTEGER) | cpu_utilization(DECIMAL) | log_timestamp(TIMESTAMP) |
|---|---|---|---|
| 1 | 101 | 95 | 2026-03-04 10:00:00 |
| 2 | 101 | 92 | 2026-03-04 10:01:00 |
| 3 | 101 | 93 | 2026-03-04 10:02:00 |
| 4 | 101 | 94 | 2026-03-04 10:03:00 |
| 5 | 101 | 96 | 2026-03-04 10:04:00 |
| 6 | 101 | 91 | 2026-03-04 10:05:00 |
| 7 | 101 | 92 | 2026-03-04 10:06:00 |
| 8 | 101 | 93 | 2026-03-04 10:07:00 |
| 9 | 101 | 94 | 2026-03-04 10:08:00 |
| 10 | 101 | 95 | 2026-03-04 10:09:00 |
| 11 | 101 | 90 | 2026-03-04 10:10:00 |
| 12 | 102 | 95 | 2026-03-04 10:00:00 |
| server_id(INTEGER) | hotspot_start(TIMESTAMP) | hotspot_end(TIMESTAMP) | consecutive_minutes(INTEGER) |
|---|---|---|---|
| 101 | 2026-03-04 10:00:00 | 2026-03-04 10:09:00 | 10 |