Skip to content

[Bug] Skywalking Java Agent Fails to Collect Elasticsearch Query Requests After ES Client Upgrade #13446

@chj9

Description

@chj9

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

Java Agent (apache/skywalking-java)

What happened

Environment:

  • Skywalking Java Agent Version: 9.5.0
  • JDK Version: 21.0.8
  • Spring Boot Version: 2.7.18

After upgrading the Elasticsearch (ES) client dependency used in the Spring Boot application, the Skywalking Java Agent (v9.5.0) can no longer collect ES query request data.

With the old ES client dependencies, the agent worked normally and successfully captured ES query-related metrics and traces. However, after switching to the officially recommended ES client version, all ES query request collection functionality stopped working—no ES-related data is displayed in the Skywalking UI.

What you expected to happen

The Skywalking Java Agent (v9.5.0) should consistently collect and report ES query request data, regardless of whether the application uses the old ES client dependencies or the officially recommended new ES client dependency.

How to reproduce

  1. Set up a Spring Boot 2.7.18 application with JDK 21.0.8, and integrate Skywalking Java Agent 9.5.0 (configure the agent according to standard Skywalking setup guidelines).
  2. Add old ES client dependencies to the application's build file (e.g., Gradle):
    api "org.elasticsearch:elasticsearch:7.16.3"
    api "org.elasticsearch.client:elasticsearch-rest-client:7.16.3"
    api "org.elasticsearch.client:elasticsearch-rest-high-level-client:7.16.3"
  3. Implement a simple ES query function (e.g., search, index) in the application, and trigger the query.
  4. Check the Skywalking UI—verify that ES query request data (traces, metrics) is correctly collected and displayed.
  5. Replace the old ES client dependencies with the officially recommended new dependency in the build file:
    api "co.elastic.clients:elasticsearch-java:7.16.3"
  6. Rebuild and restart the application, then trigger the same ES query function again.
  7. Check the Skywalking UI—observe that no ES query request data is collected or displayed (the agent fails to capture the requests).

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working and you are sure it's a bug!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions