-
Notifications
You must be signed in to change notification settings - Fork 146
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
fix(tracer): properly return DynamoDB.DocumentClient #528
Conversation
Attaching an archive with a packed version of this branch ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add get
or put
calls in the e2e as well ?
Here at this link you can find a successful e2e test execution with the new changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for also updating the e2e tests.
packages/tracing/src/Tracer.ts
Outdated
// This is needed because some aws-sdk clients like AWS.DynamoDB.DocumentDB don't comply with the same | ||
// instrumentation contract like most base clients. | ||
// For detailed explanation see: https://github.com/awslabs/aws-lambda-powertools-typescript/issues/524#issuecomment-1024493662 | ||
this.provider.captureAWSClient((service as unknown as T & { service: T }).service); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed investigation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dreamorosi question just for myself.
Why do we cast to unknown
first and as T
in the 2nd step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, it's a leftover from a previous experiment and it's not needed since T
is already a generic. Fixed in latest commit.
Description of your changes
This PR aims at fixing the bug identified in #524.
How to verify this change
Check GitHub actions execution results, the unit tests now include test cases to assert on the type of client being returned.
Related issues, RFCs
#524
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
N/A
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.