How do I capture the opensearch client to get additional X-Ray traces?

0

I AM USING THIS CODE IN A LAMBDA WITH X-RAY ENABLED.

I want to use captureAWSv3Client, to get additional opensearch information on X-Ray, the same way you can do it with DynamoDB, but i have been unable to do it.

I receive an error when using the client from @opensearch-project/opensearch.

import { captureAWSv3Client } from "aws-xray-sdk";
import { Client } from "@opensearch-project/opensearch";

const openProjectClient = new Client({});

captureAWSv3Client(openProjectClient); // Error: Argument of type 'Client' is not assignable to parameter of type middlewareStack

openProjectClient.search({});

Is it possible to capture the javascript opensearch client?


In a side note i just realized that i can do this:

import { OpenSearchClient } from "@aws-sdk/client-opensearch";
const awsOPServiceClient = new ElasticsearchServiceClient();
captureAWSv3Client(awsOPServiceClient);
awsOPServiceClient.search(); // Does to exist
awsOPServiceClient .send(new Search()); // Does not exist

But i cannot do any service action with OpenSearchClient

luis
質問済み 5ヶ月前179ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ