Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenSearch] Java Instrumentation not working when using OpenSearch-java with AwsSdk #6599

Open
paulcerverayalvarez opened this issue Feb 1, 2024 · 0 comments
Labels

Comments

@paulcerverayalvarez
Copy link

The instrumentation of opensearch in JAVA does not work with opensearch-java and the aws-sdk.

The current integration only covers opensearch-rest and opensearch-transport. When using a managed OpenSearch by AWS, we should use the openSearch-java according to the AWS Documentation which does not use the opensearch-rest or opensearch-transport implementation.

SdkHttpClient httpClient = ApacheHttpClient.builder().build();

OpenSearchClient client = new OpenSearchClient(
    new AwsSdk2Transport(
        httpClient,
        "search-...us-west-2.es.amazonaws.com", // OpenSearch endpoint, without https://
        "es",
        Region.US_WEST_2, // signing service region
        AwsSdk2TransportOptions.builder().build()
    )
);

InfoResponse info = client.info();
System.out.println(info.version().distribution() + ": " + info.version().number());

httpClient.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants