open-telemetry / open-telemetry/opentelemetry-java-instrumentation

Deprecate elasticsearch-rest-7.0 library instrumentation and collapse elasticsearch-rest-common-5.0 to javaagent-only

Open
#19,697 1 comment 0 reactions 1 assignee View on GitHub

@trask is already working on this.

Since Aug 18, 2026.

enhancement needs triage
Dominant language
Java
Stars
2.6k
Forks
1.2k
Avg merge
2d 18h
Merged PRs (30d)
228

Description

Is your feature request related to a problem? Please describe.

elasticsearch-rest-7.0/library was added in July 2023 (#8867 → #8911) as a stopgap for users on elasticsearch-java who were waiting for native OpenTelemetry in the client. That landed about two months later, in 8.10 and 7.17.20.

It is expensive for what it does. It builds a ByteBuddy subclass of a concrete RestClient at runtime, discovers a constructor by matching parameter shapes, injects the generated class into Elastic's class loader, plants a RestClientPackageAccess shim inside org.elasticsearch.client, and routes every call through reflection.

It is also the only non-javaagent consumer of elasticsearch-rest-common-5.0/library. That module is published as opentelemetry-elasticsearch-rest-common-5.0 even though every class in it is internal.

Describe the solution you'd like

Two steps.

  1. Deprecate elasticsearch-rest-7.0/library and point users at the client's own native instrumentation.
  2. Once that removes its only non-javaagent consumer, collapse elasticsearch-rest-common-5.0 to javaagent-only.
Additional context

#19675 is adding query text sanitization only for elasticsearch javaagent instrumentation because it requires having access to a json parser.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.