有没有任何方法可以在AWS NodeJS SDK v3中使用X射线仪器?在sdkv2中,AWSXray能够捕获任何客户机并将其插入仪器以跟踪到XRay中.
const {DynamoDBClient, ScanCommand} = require("@aws-sdk/client-dynamodb");
const AWSXRay = require("aws-xray-sdk");
// if uncommented, this throws an exception
// AWSXRay.captureAWSClient(DynamoDBClient);
const client = new DynamoDBClient({region: process.env.AWS_REGION});
// if uncommented, this throws an exception
// AWSXRay.captureAWSClient(client);
const scan = new ScanCommand({
TableName: 'xxx',
});
await client.send(scan) //?
但两条 comments 行都有service.customizeRequests is not a function
条.这似乎表明AWS SDK s3与原始AWSXRay库不向后兼容.
我发现sdkv3包含XRay客户端,但这只是一个可以将跨距和跟踪发送到AWS的客户端,而不是插装代理.
对于NodeJS,建议使用带AWS SDK v3的X射线仪器的模式是什么?