是否可以仅通过使用客户端包装器来使用 AWS X-ray SDK 来检测 Node.js 应用程序,而无需使用段和子段?该应用程序有点遗留,它使用@elastic/elasticsearch 5.6.22(目前我无法对其进行升级)。
例如:
var esClient = AWSXray.captureAWSClient(new elasticsearch.Client({ host: myhost, apiVersion: '5.6', requestTimeout: 240000, }):
我遇到的问题是 AWSXRay.captureAWSClient 函数尝试调用不存在的“elasticsearch.Client”实例上的方法(“customizeRequests”)。我收到错误:
uncaught Exeption: TypeError: service.customizeRequests is not a function
看起来,elasticsearch.Client 与 AWSXRay.captureAWSClient 机制不兼容。然而,为每个 Elasticsearch 操作手动创建段和子段将是一项繁重的工作。我只是希望有一种更简单的方法来完成此检测,以便我可以获得分布式跟踪。
不。
new elasticsearch.Client
不是客户端实现的 AWS 客户端接口