Skip to content

Add Elasticsearch Java client plugin for 7.x-9.x#804

Open
wu-sheng wants to merge 4 commits intomainfrom
elasticsearch-java-plugin
Open

Add Elasticsearch Java client plugin for 7.x-9.x#804
wu-sheng wants to merge 4 commits intomainfrom
elasticsearch-java-plugin

Conversation

@wu-sheng
Copy link
Copy Markdown
Member

@wu-sheng wu-sheng commented Apr 9, 2026

Summary

  • Add new plugin for co.elastic.clients:elasticsearch-java, the modern Elasticsearch Java client that replaces the deprecated REST High Level Client
  • Covers both 7.x (RestClientTransport.performRequest directly) and 8.x/9.x (ElasticsearchTransportBase.performRequest) code paths using witness classes for version detection
  • Constructor interceptor extracts peer addresses from RestClient.getNodes()
  • performRequest interceptor creates ExitSpan with Elasticsearch/{endpoint.id()} operation name, db.type=Elasticsearch, SpanLayer.DB
  • Tested versions: 7.17.22, 8.5.3, 8.12.2, 8.17.0, 9.0.0 (8.17.0 verified locally)
  • Resolves [Bug] Skywalking Java Agent Fails to Collect Elasticsearch Query Requests After ES Client Upgrade skywalking#13447

Test plan

  • CI E2E tests for all 5 versions (7.17.22, 8.5.3, 8.12.2, 8.17.0, 9.0.0)
  • Verify trace segments include correct operation names (Elasticsearch/create, Elasticsearch/index, etc.)
  • Verify peer addresses are captured correctly
  • Verify both 7.x and 8.x/9.x code paths via witness class activation

Add plugin for co.elastic.clients:elasticsearch-java, the modern
Elasticsearch Java client that replaces the deprecated REST High Level
Client. Covers both 7.x (RestClientTransport.performRequest) and
8.x/9.x (ElasticsearchTransportBase.performRequest) code paths using
witness classes for version detection.

Tested versions: 7.17.22, 8.5.3, 8.12.2, 8.17.0, 9.0.0.
Local verification passed for 8.17.0.
@wu-sheng wu-sheng added enhancement New feature or request feature labels Apr 9, 2026
@wu-sheng wu-sheng added this to the 9.7.0 milestone Apr 9, 2026
wu-sheng added 3 commits April 9, 2026 23:08
elasticsearch-java 9.0.0 is compiled for JDK 17 (class version 61),
so it cannot be tested in the JDK 8 test container. Split into a
separate elasticsearch-java-9.x-scenario using Spring Boot 3.x and
JDK 17 compiler target, added to plugins-jdk17-test.1.yaml.
Fix jar name in assembly.xml, correct support-version.list,
and add to plugins-jdk17-test.1.yaml instead of replacing the
JDK 8 scenario entry.
…oconfig

- Use ES 9.0.0 server image instead of 8.17.0 for the 9.x scenario
- Exclude ElasticsearchClientAutoConfiguration to avoid Spring Boot
  auto-config conflict with ES Java client constructor changes
- Verified locally: 9.0.0 passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant