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

Sem respostas

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas