-
Notifications
You must be signed in to change notification settings - Fork 117
[aws-lambda]Added New Lambda Wrapper Code for Manual Instrumentation #408
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #408 +/- ##
============================================
+ Coverage 83.07% 83.26% +0.18%
- Complexity 1530 1548 +18
============================================
Files 97 98 +1
Lines 6115 6196 +81
============================================
+ Hits 5080 5159 +79
- Misses 1035 1037 +2 Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Some tests and static analysis would be nice. Also need to add it to .github/workflows and .gitsplit.yaml |
Let me add those and get back to you. |
Added unit tests for this new class. Didn't need to update the github/workflows and .gitsplit since the new AwsLambdaWrapper class is within the aws contrib pkg. |
0be89cb
to
06fe0d1
Compare
Description:
Added new code to allow customers to manually instrument their PHP Lambda Handlers using Bref. This is based on Lambda Handler Instrumentation in .NET and other languages. I added a README on how to use but the idea here is that the customer will write their own handler function then call
AWSLambdaWrapper::getInstance()->WrapFunctinon($originalHandler). The
WrapFunction` uses a Tracer to create the lambda root span as a server span and add FAAS specific attributes to it regarding the handler function itself.This is a full example:
Testing:
Wrote a minimal lambda function handler that using Bref and Serverless.
This is the example function:
After deploying to my AWS Account and triggering the function (with AWS X-Ray Tracing Enabled), below is a sample trace. From that trace, we can verify that: