Plumb error info to X-ray #544
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
None
Description of changes:
This change fixes a divergence in behavior between the
go1.xruntime, and theprovided.XYZruntime family. Ingo1.x, thegithub.com/aws/aws-lambda-go/messages/InvokeResponse_Errorstruct is wrapped in a certain way and then presented to the AWS X-Ray services in Lambda's default trace documents. In the Lambda Runtime API, this structure is passed as theLambda-Runtime-Function-Xray-Error-Causeheader.Lambda's Java Runtime Interface Client is one public reference of this behavior. https://github.com/aws/aws-lambda-java-libs/blob/3d8dfb66f3a852bf69618bd5f66222692f1f5a49/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/AWSLambda.java#L264
When X-Ray is enabled for a function, this populates the "Exceptions" tab when viewing a trace.
For reference, here's what the tab renders for a
go1.xfunction.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.