Amazon Connect writes detailed operational logs to Amazon CloudWatch Logs across multiple log groups. These include Contact Flow execution logs (every block execution, transfer, and error), Lambda function invocation logs, instance-level audit logs, and real-time metrics. Analyzing these logs is essential for troubleshooting call flow issues, diagnosing Lambda failures, auditing agent actions, and optimizing your contact center performance.
Where are Amazon Connect CloudWatch log groups located?
Connect logs appear in: /aws/connect/INSTANCE-ID (Contact Flow execution logs, one stream per ContactId), /aws/lambda/FUNCTION-NAME (Lambda function logs invoked from flows), /aws/connect/instance/INSTANCE-ID/contact-flow (flow-level logs), and custom log groups configured in your flows. Enable Contact Flow logs in the Amazon Connect console under Flows → Log group settings.
How do I enable Contact Flow logging in Amazon Connect?
Go to Amazon Connect console → Data Storage → Contact Trace Records → Enable Contact Flow logs. Alternatively, add a Set logging behavior block at the start of each contact flow with Enable Logging set to Yes. Logs appear in CloudWatch under /aws/connect/{instance-id} within seconds. Each contact creates a separate log stream named by ContactId.
What does a Contact Flow log entry look like?
A typical entry: {"ContactId":"abc-123","Identifier":"uuid","ContactFlowName":"Main Flow","ContactFlowModuleType":"PlayPrompt","Timestamp":"2024-01-15T10:32:01Z","Results":"Success"}. Error entries include an Error field describing what failed — e.g., Lambda timeout, invalid attribute reference, or missing queue. The ContactFlowModuleType tells you exactly which block type executed.
How do I diagnose Lambda timeouts in Amazon Connect flows?
Look for REPORT lines in Lambda logs with Duration close to the configured timeout (default 3s for Connect-invoked Lambdas, max 8s). Check for "Task timed out" in the error message. Common causes: slow DynamoDB queries, external API calls without timeout handling, VPC cold starts adding 500ms-2s latency. Increase Lambda timeout in Connect to max 8s and add circuit-breaker patterns in your Lambda code.
What is a cold start in AWS Lambda and how does it affect Connect?
A cold start occurs when Lambda must initialize a new execution environment — loading your code, runtime, and initializing the execution context. This adds 100ms–2s+ latency (more for Java/C#, less for Python/Node.js). In Connect flows, Lambda cold starts cause longer IVR response times. Mitigate with: Provisioned Concurrency, keeping functions warm with EventBridge scheduled pings, or using Lambda SnapStart (Java).
How do I use CloudWatch Logs Insights to analyze Connect logs?
Use queries like: fields @timestamp, ContactId, ContactFlowModuleType, Error | filter Error != "" | sort @timestamp desc | limit 50 to find all flow errors. For Lambda: fields @timestamp, @requestId, @duration, @billedDuration | filter @type="REPORT" | sort @duration desc to find slowest invocations. Export results as JSON and paste them directly into this tool for structured analysis.