Skill 2.5.6

Improve troubleshooting efficiency for FM applications (for example, by using CloudWatch Logs Insights to analyze prompts and responses, X-Ray to trace FM API calls, Amazon Q Developer to implement GenAI-specific error pattern recognition)

Key Concepts

With model invocation logging to CloudWatch Logs, CloudWatch Logs Insights queries find requests with high token counts, errors, specific phrases in prompts or responses, or the slowest calls. Application logs that include request IDs, prompt versions and model IDs make correlation easy.

AWS X-Ray traces show each FM API call as a subsegment with its duration and errors, revealing whether latency comes from retrieval, the model or a tool. Amazon Q Developer can analyse error messages, logs and stack traces, explain GenAI-specific failures such as validation errors from malformed message sequences, and suggest fixes.