aws / aws/aws-xray-sdk-node

Using `captureAWSClient` over directly referenced dynamodb client fails

Open
#23 27 comments 0 reactions 1 assignee Claimed by @willarmiros View on GitHub
enhancement
Dominant language
JavaScript
Stars
280
Forks
157
PR merge metrics
No merged PRs in 30d

Description

The following code does not work:

```js
const DynamoDB = require('aws-sdk/clients/dynamodb')
const xray = require('aws-xray-sdk-core')
const ddb = xray.captureAWSClient(new DynamoDB())
```

In theory, it should be just the same as encapsulating `new AWS.DynamoDB()` coming straight from `aws-sdk`, but it does not work.

This is specially problematic in AWS Lambda environment, where loading more than you need makes you use more memory and more time.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.