open-telemetry / open-telemetry/opentelemetry-java-instrumentation
Deprecate elasticsearch-rest-7.0 library instrumentation and collapse elasticsearch-rest-common-5.0 to javaagent-only
@trask is already working on this.
Since Aug 18, 2026.
- 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.
- Deprecate
elasticsearch-rest-7.0/libraryand point users at the client's own native instrumentation. - Once that removes its only non-javaagent consumer, collapse
elasticsearch-rest-common-5.0to 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.