aws-cloudwatch-investigation

Provides CloudWatch Logs Insights queries and metric patterns for structured incident triage.

38.5k|4.9k|Updated Jun 11, 2025
One-click install
npx skills add https://github.com/github/awesome-copilot --skill aws-cloudwatch-investigation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: aws-cloudwatch-investigation
Source: https://github.com/github/awesome-copilot/tree/main/skills/aws-cloudwatch-investigation
Command: npx skills add https://github.com/github/awesome-copilot --skill aws-cloudwatch-investigation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Investigating AWS production incidents often involves ad-hoc, inconsistent querying of CloudWatch Logs, Metrics, and Alarms, which slows down root cause identification and makes triage hard to repeat.

Core Features & Use Cases

  • Logs Insights Query Templates: Ready-to-use queries for error spike detection, P99 latency breakdown, Lambda cold starts, OOM detection, and timeout identification.
  • Alarm-to-Deployment Correlation: A process using CloudTrail Lake queries to link alarm transitions to recent deployment events with defined correlation criteria.
  • Blast Radius Decision Tree: A systematic account-to-resource narrowing flow, plus an ordered checklist for investigating shared dependencies like VPC, IAM, and downstream services.
  • Metric Math Patterns: GetMetricData expressions for error rate percentage, latency anomaly detection against baselines, throttling pressure scores, and concurrency headroom.
  • Use Case: During a Lambda incident, use the error spike query to find failing log streams, correlate the alarm time with a recent UpdateFunctionCode event in CloudTrail, and reconstruct a timeline to identify the deploy as the root cause.

Quick Start

Use the aws-cloudwatch-investigation skill to help me triage a Lambda error alarm that started firing 30 minutes ago.

Frequently Asked Questions about aws-cloudwatch-investigation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find error spikes in CloudWatch Logs Insights?▼

Use a Logs Insights query that filters messages matching error patterns like /(?i)(error|exception|fatal|critical)/, then aggregate with stats count by 5-minute bins and log stream. Sorting by error count descending surfaces the noisiest sources first.

How to correlate a CloudWatch alarm with a recent deployment?▼

Note the exact alarm transition timestamp, then query CloudTrail Lake for deployment events like UpdateFunctionCode or CreateDeployment in the prior 30 minutes. A deploy is correlated if it targets the same resource, completed within 15 minutes before the alarm, and came from a CI/CD role.

How do I detect Lambda cold starts in CloudWatch logs?▼

Filter log entries where @initDuration is present, since that field only appears on cold start invocations. Aggregate count, average, and max init duration by 5-minute bins to quantify cold start frequency and impact during an incident.

Can CloudWatch metric math detect latency anomalies?▼

Yes, use GetMetricData with two p99 Duration queries—one for the current window and one for the same window last week—then divide them in a metric math expression. A ratio above 2 indicates an anomalous latency regression versus baseline.

Why does my CloudWatch alarm fire later than the actual problem?▼

Alarm state changes include a built-in evaluation delay equal to the period multiplied by the number of evaluation periods. Metric timestamps are also end-of-period, so the underlying anomaly typically started earlier than the alarm transition time suggests.

What are the limitations of CloudTrail for incident timelines?▼

CloudTrail events can have up to 15-minute delivery delay, so recent changes may not appear immediately. Always use eventTime rather than ingestion time when reconstructing timelines, and cross-check with logs and metrics for the earliest symptom.