Skill 4.1.5

Use AWS AI tools to analyze errors and to generate troubleshooting suggestions.

Key Concepts

CloudWatch investigations is a generative AI feature of Amazon CloudWatch for operational troubleshooting. An investigation can be started from an alarm, a metric graph or a Logs Insights query, or automatically when an alarm fires. It analyses metrics, logs, deployment events, AWS Health events, CloudTrail change events and X-Ray traces, and presents observations, suggestions and root-cause hypotheses, with a diagram when several resources are involved. Without configuration, an investigation uses the signed-in user's permissions and runs once; after an investigation group is configured, team members can share investigations, accept or discard suggestions, run suggested Systems Manager Automation runbooks and generate incident reports. Every action it takes is recorded in CloudTrail.

The CloudWatch Logs Insights query generator turns a plain-language request, such as "show the 20 slowest invocations in the last hour with their request IDs", into a query with a line-by-line explanation. It needs the cloudwatch:GenerateQuery permission, and the generated query should be read before it is trusted.

Kiro analyses errors in the code. Pasting a stack trace or log excerpt into a session lets the agent locate the failing code, explain the cause and propose a fix. A bugfix spec structures the work: bugfix.md records the current behaviour, the expected behaviour and the behaviour that must not change, and the agent then identifies the root cause, designs the fix and adds regression tests. With an MCP server for CloudWatch, the agent can query logs and metrics itself.

AI suggestions are verified before anything changes in production: confirm the hypothesis against the metrics and logs, reproduce the failure, apply the fix through the normal pipeline and check that the error rate returns to normal.