aws-samples / aws-xray-sdk-node-sample

The official sample app for the AWS X-Ray SDK for Node.js
MIT No Attribution
20 stars 17 forks source link

Needs update to show usage of aws-sdk v3 #1

Open igilham opened 3 years ago

igilham commented 3 years ago

This sample is linked from the AWS documentation so it should be updated to demonstrate the usage of the new version of the SDK (@aaws-sdk/client-s3 etc.)

If I have understood the documentation correctly, the only change is to upgrade the aws-sdk to v3 using the new client packages, wrap clients with captureAWSClient and remove the following line:

const AWS = AWSXRay.captureAWS(require('aws-sdk'));
willarmiros commented 3 years ago

@igilham we have not merged support for instrumenting AWS SDK v3 quite yet, we are still waiting on https://github.com/aws/aws-xray-sdk-node/pull/298/. Unfortunately instrumentation will not be as straightforward as you've suggested. Once that is released, we will revisit this.

igilham commented 3 years ago

Thanks for responding. I have discovered that it can't be anywhere near as simple as I would wish. I tried capturing some v3 clients before I realised that it wasn't supported and saw a glimpse of the challenges that would cause.

Never mind. I'm sure it will be resolved as the v3 libs mature and you work on the support.

gcobr commented 3 weeks ago

@igilham we have not merged support for instrumenting AWS SDK v3 quite yet, we are still waiting on aws/aws-xray-sdk-node#298. Unfortunately instrumentation will not be as straightforward as you've suggested. Once that is released, we will revisit this.

@willarmiros SDK 2 has now been deprecated by AWS, and these are the official examples linked to AWS documentation. They should be updated to use the SDK 3 without further delays. It’s not a trivial migration for developers, and they really need clear examples from AWS.