Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plumb error info to X-ray #544

Merged
merged 7 commits into from Jan 25, 2024
Merged

Plumb error info to X-ray #544

merged 7 commits into from Jan 25, 2024

Conversation

bmoffatt
Copy link
Collaborator

@bmoffatt bmoffatt commented Jan 4, 2024

Issue #, if available:

None

Description of changes:

This change fixes a divergence in behavior between the go1.x runtime, and the provided.XYZ runtime family. In go1.x, the github.com/aws/aws-lambda-go/messages/InvokeResponse_Error struct 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 the Lambda-Runtime-Function-Xray-Error-Cause header.

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.

Screenshot 2024-01-24 at 9 27 19 AM

For reference, here's what the tab renders for a go1.x function.

Screenshot 2024-01-24 at 9 29 52 AM

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (3a93ed1) 72.95% compared to head (7ba157c) 73.30%.

Files Patch % Lines
lambda/invoke_loop.go 85.71% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #544      +/-   ##
==========================================
+ Coverage   72.95%   73.30%   +0.34%     
==========================================
  Files          26       26              
  Lines        1457     1487      +30     
==========================================
+ Hits         1063     1090      +27     
- Misses        322      324       +2     
- Partials       72       73       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmoffatt bmoffatt marked this pull request as ready for review January 24, 2024 19:07
@bmoffatt bmoffatt assigned bmoffatt, smirnoal, andclt and krk and unassigned bmoffatt Jan 24, 2024
@bmoffatt bmoffatt merged commit 58da2cc into aws:main Jan 25, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants