feat: add support for hbase-client 1.4#19087
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds OpenTelemetry javaagent instrumentation support for hbase-client versions [1.4.0, 2.0.0). To do this it restructures the existing hbase-client-2.0 instrumentation: the module is moved under a new instrumentation/hbase/ parent, and the shared, version-independent pieces (instrumenter factory, request/context model, thread-local state, attributes getter, and the package-private Call accessor helper) are extracted into a new hbase-client-common module so both the 1.4 and 2.0 modules can reuse them. A new hbase-client-1.4 module supplies the 1.x-specific bytecode advice and muzzle range. The shared abstract test is parameterized with hook methods (instrumentationName(), createTable(), putOperation(), getTimeoutClientRetriesNumber()) so each version provides its own table-creation API and expected operation names.
Changes:
- Extract shared HBase instrumentation logic into a new
hbase-client-common(javaagent + testing) module and movehbase-client-2.0underinstrumentation/hbase/. - Add a new
hbase-client-1.4javaagent module (instrumentation, muzzle[1.4.0,2.0.0), tests, metadata). - Update build wiring,
settings.gradle.kts,.fossa.yml,docs/instrumentation-list.yaml, and latest-dep version config to reflect the new module layout.
Reviewed changes
Copilot reviewed 31 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
settings.gradle.kts |
Registers the new hbase modules and removes the old hbase-client-2.0 entries |
.../hbase-client-common/testing/.../AbstractHbaseTest.java |
Parameterizes the shared test with version-specific hooks; switches checkAndMutate to the common API |
.../hbase-client-common/testing/build.gradle.kts |
New testing module build config |
.../hbase-client-common/javaagent/.../OpenTelemetryCallUtil.java |
Updates import to the common RequestAndContext |
.../hbase-client-common/javaagent/.../RequestAndContext.java, HbaseRequest.java, HbaseAttributesGetter.java |
Repackaged into ...client.common |
.../hbase-client-common/javaagent/.../HbaseInstrumenterFactory.java, HbaseClientState.java |
New shared factory and thread-local state holder |
.../hbase-client-common/javaagent/build.gradle.kts |
New common javaagent build config |
.../hbase-client-2.0/... (metadata, tests, instrumentation, singletons, module, build) |
Moved/updated to use the common module |
.../hbase-client-1.4/... (metadata, tests, instrumentation, singletons, module, build) |
New 1.4 instrumentation mirroring the 2.0 pattern |
instrumentation/hbase-client-2.0/.../HbaseSingletons.java |
Old singleton removed (logic split into common) |
docs/instrumentation-list.yaml |
Adds 1.4 entry and fixes 2.0 source path |
.github/config/latest-dep-versions.json |
Adds 1.7.+ latest-dep pins |
.fossa.yml |
Updates FOSSA targets to new module paths |
|
@laurit Please help fix the code conflicts and review the changes. |
|
This PR has review comments. Review suggestions, whether from maintainers or automated reviewers, aren't always correct or required. Please evaluate each comment on its merits, then make sure each thread has a clear outcome. For example, link to the commit if you applied a suggestion, explain why it wasn't applied, or ask a follow-up question. Automation flags a PR for human review once every review thread has a reply or is marked as resolved. Status across open PRs is visible on the pull request dashboard. |
|
@laurit @jaydeluca Hi both, kindly re-review and advise if any changes are needed. |
|
@YaoYingLong can you resolve the merge conflicts? |
@jaydeluca Fix merge conflicts and complete batchSize feature. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 39 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
instrumentation/hbase/hbase-client-common-1.4/javaagent/src/main/java/org/apache/hadoop/hbase/ipc/OpenTelemetryCallUtil.java:12
- [Bug]
OpenTelemetryCallUtilis listed inHbaseInstrumentationModule.injectedClassNames(), so it will be defined in the instrumented library’s class loader. In that context it cannot reference agent-only types likeio.opentelemetry.javaagent.instrumentation.hbase.client.common.RequestAndContext(field generic +RequestAndContext.classliteral), otherwise class definition/linkage will fail.
A common pattern here is to store the value as Object (e.g., VirtualField<Call, Object> = VirtualField.find(Call.class, Object.class)), have setRequestAndContext(..., @Nullable Object) and getAndClearRequestAndContext(...) return @Nullable Object, and then cast back to RequestAndContext in the advice code that reads it.
|
Thank you for your contribution @YaoYingLong! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
Add support for HBase versions [1.4.0, 2.0.0)