Adding custom attributes to AWS SDK v3 calls
paddymccarroll opened this issue · 4 comments
paddymccarroll commented
Is it possible to add our own custom attributes to segments created using captureAWSv3Client
? For example, I would like to add query information from DynamoDB calls.
wangzlei commented
yes, AWS SDK v2 instrumentation is by middleware stack, user can customize XRay SDK's AWS sdk v3 instrumentation here https://github.com/aws/aws-xray-sdk-node/blob/e21281fc98d7a8a4eb2d96b64de60c295f474c1b/packages/core/lib/patchers/aws3_p.ts
One idea I haven't tried. User can add a new middleware after xray sdk's, use API AWSXRay.getSegment();
to add more attributes on AWS SDK v2 subsegment.
paddymccarroll commented
Thanks for pointing me in the right direction, I'll give that a go.