Repository navigation
Conversation
Pull request dashboard statusMerged · refreshed 2026-09-10 16:27 UTC Status above doesn't look right?
|
There was a problem hiding this comment.
Pull request overview
Adds configured Elasticsearch REST targets and actual network-peer telemetry while preserving legacy span naming and server attributes.
Changes:
- Captures immutable configured targets for Elasticsearch 5.x–7.x clients.
- Propagates actual socket peers from Apache HttpAsyncClient.
- Updates stable span names, attributes, documentation, and tests.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.../ElasticsearchServerTargetTest.java |
Tests target normalization and sanitization. |
.../ElasticsearchDbAttributesGetterTest.java |
Tests peer attribute extraction. |
.../ElasticsearchSpanNameExtractor.java |
Uses stable database span naming. |
.../ElasticsearchServerTarget.java |
Models sanitized configured targets. |
.../ElasticsearchRestRequest.java |
Carries target and peer state. |
.../ElasticsearchDbAttributesGetter.java |
Exposes server and network-peer attributes. |
.../ElasticsearchClientAttributeExtractor.java |
Preserves configured stable targets. |
.../ElasticsearchServerTargets.java |
Stores targets in a virtual field. |
elasticsearch-rest-7.0/library/.../ElasticsearchRest7Test.java |
Tests library target behavior. |
.../RestClientWrapper.java |
Adds builder wrapping and target capture. |
.../ElasticsearchRest7Telemetry.java |
Exposes the builder overload. |
elasticsearch-rest-7.0/library/README.md |
Documents builder-based wrapping. |
elasticsearch-rest-7.0/javaagent/.../ElasticsearchRest7Test.java |
Tests 7.x agent attributes and targets. |
elasticsearch-rest-7.0/javaagent/.../RestClientInstrumentation.java |
Propagates target and peer state. |
elasticsearch-rest-7.0/javaagent/.../RestClientConstructorInstrumentation.java |
Captures initial 7.x nodes. |
.../ElasticsearchRest7InstrumentationModule.java |
Registers constructor instrumentation. |
elasticsearch-rest-6.4/javaagent/.../ElasticsearchRest6Test.java |
Tests 6.x agent behavior. |
elasticsearch-rest-6.4/javaagent/.../RestClientInstrumentation.java |
Propagates 6.x target and peer state. |
elasticsearch-rest-6.4/javaagent/.../RestClientConstructorInstrumentation.java |
Captures initial 6.x nodes. |
.../ElasticsearchRest6InstrumentationModule.java |
Registers constructor instrumentation. |
elasticsearch-rest-5.0/javaagent/.../ElasticsearchRest5Test.java |
Tests 5.x agent behavior. |
elasticsearch-rest-5.0/javaagent/.../RestClientInstrumentation.java |
Propagates 5.x target and peer state. |
elasticsearch-rest-5.0/javaagent/.../RestClientConstructorInstrumentation.java |
Captures initial 5.x hosts. |
.../ElasticsearchRest5InstrumentationModule.java |
Registers constructor instrumentation. |
.../ElasticsearchClientTest.java |
Verifies API-client target and peer telemetry. |
.../ApacheHttpAsyncClientInstrumentation.java |
Captures the connected socket peer. |
.../SearchPeerStateTest.java |
Tests peer-state propagation and replacement. |
.../SearchPeerState.java |
Implements nested peer capture state. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fa8f77f to
51011a0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/v4_1/ApacheHttpAsyncClientInstrumentation.java:248
- [General] This open-state guard drops the peer for transport failures that close or begin closing an established connection before
failed()runs. Apache'sHttpInetConnectionaddress accessors do not requireisOpen(), and the following null/port checks already omit connections without a resolved endpoint. Removing this guard lets failed Elasticsearch spans retain the last resolved socket peer as intended.
if (!inetConnection.isOpen()) {
return;
}
eb65c17 to
041941b
Compare
ce9e4e7 to
a94bc5b
Compare
e10978b to
2619d2a
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2619d2a to
3b1f512
Compare
…n-telemetry#19901) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Capture configured Elasticsearch REST nodes at client construction and use that immutable target for stable database server attributes and span names, so sniffing and setNodes changes do not alter telemetry identity.
This PR is part of #19899 and applies the configured database target rules proposed in open-telemetry/semantic-conventions#4058 to the Elasticsearch REST client.
Configured target
A single configured host reports
server.address=es.example, plusserver.port=9200when the port is not the scheme default. Host lists preserve duplicates, use deterministic lexical ordering, and report at most the first five endpoints. When every endpoint uses its scheme default, ports andserver.portare omitted. If any endpoint in a multi-host target uses a non-default port, every endpoint keeps its effective port inserver.address, including default-port members, andserver.portis omitted.