4.2.6 · Lesson 10 of 16
Profile Bottlenecks Across FM, Retrieval, and Tools
Find where latency and cost accumulate across orchestration steps using distributed tracing and log analytics.
WHAT
Profile bottlenecks across FM calls, retrieval, and tools in GenAI workflows.
HOW
- AWS X-Ray: Trace API Gateway → Lambda → Bedrock → external tools.
- CloudWatch Logs Insights: Analyze prompt-to-token ratios, token spikes, and max-token truncations.
Client → API Gateway → Lambda → Bedrock → Tools
↑
X-Ray traceKey points
- AWS X-Ray across API → Lambda → Bedrock → tools
- CloudWatch Logs Insights
- Prompt-to-token ratios
- Max token truncation diagnosis
- Multi-agent bottleneck finding
Exam focus
X-Ray answers where the request was slow across services; Logs Insights analyzes token spikes and truncation in invocation logs.