Yes, you are correct, with the following caveats:
- You need to check the Enable Active Tracing checkbox in the Lambda console. From your function in the console > Configuration tab > Advanced dropdown/section > check Enable Active Tracing checkbox > Save.
When you follow the step above, the console will advise that the IAM policy that the function executes under will be modified. If you're using a role created by the console when creating a function, you may need to modify the role manually. Either create a new policy and attach it to the role, create an inline policy attachment, or edit the existing policy for the role with a SID like this (this is an example - use globs in IAM policies with great care):
{
"Sid": "AllowXRay",
"Resource": "*",
"Action": [
"xray:PutTraceSegments",
"xray:PutTelemetryRecords"
],
"Effect": "Allow"
}
After following these steps, I was able to see full traces of my function in the XRay console.