X-Ray traces requests across distributed services, showing latency, errors, and dependencies. For Lambda calling DynamoDB, S3, and other services, X-Ray visualizes complete request flow.
Enable X-Ray on Lambda:
aws lambda update-function-configuration \
--function-name myapp \
--tracing-config Mode=ActiveAdd X-Ray SDK to function:
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core import patch_all
patch_all() # Auto-instrument AWS SDK calls