How newrelic-experimental/newrelic-java-elasticsearch works
Project type and purpose
• This is an open-source instrumentation library (not a web or microservice) that plugs into the New Relic Java Agent to trace ElasticSearch queries.
• It consists of multiple Gradle sub-modules (elasticseach-2.x, 5.x, 6.x, 7.x, esrestclient-7.10) each producing a version-specific instrumentation JAR.
File structure
• Top-level:
• build.gradle, settings.gradle – declare a multi-module Gradle build
• .github/workflows – CI pipelines for release, changelog, linting
• modules named elasticsearch-X and esrestclient-7.10, each with its own build.gradle and src/main/java tree
• Each module:
• com/newrelic/instrumentation/elasticsearch (or labs/esrestclient) – the instrumentation hooks and query converters
• org/elasticsearch/... classes mirrored/stubbed to support bytecode weaving against ES client APIs
• No “frontend” or “backend” directories – it’s a pure instrumentation library.
README
• Describes installation (drop JAR into New Relic agent “extensions” dir) and expected runtime behavior (ES queries appear in New Relic UI).
• Build instructions show how to assemble each sub-module via Gradle.