My stage has xray tracking enabled and I can see X-Amzn-Trace-Id is coming back from API gateway, moreover, I'm able to see the whole trace from APIG to Dynamo db. I would like to save this trace id to the table, so we can debug it more efficiently, but when I map an integration like
"TableName" : "${aws_dynamodb_table.openApi_staging.id}",
"Item": {
"RequestId": {
"S": "$context.requestId"
},
"Request": {
"S": "$input.path('$')"
},
"RequestedAt": {
"S": "$context.requestTime"
},
"Status":{
"S": "New"
},
"Xray": {
"S": "_$context.xrayTraceId"
}
}
Xray is always empty! How can I obtain this id?