Skip to content

feat: add support for hbase-client 1.4#19087

Merged
trask merged 15 commits into
open-telemetry:mainfrom
YaoYingLong:feature/hbase-1.4
Jul 15, 2026
Merged

feat: add support for hbase-client 1.4#19087
trask merged 15 commits into
open-telemetry:mainfrom
YaoYingLong:feature/hbase-1.4

Conversation

@YaoYingLong

Copy link
Copy Markdown
Contributor

Add support for HBase versions [1.4.0, 2.0.0)

Copilot AI review requested due to automatic review settings June 26, 2026 12:45
@YaoYingLong YaoYingLong requested a review from a team as a code owner June 26, 2026 12:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 move hbase-client-2.0 under instrumentation/hbase/.
  • Add a new hbase-client-1.4 javaagent 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

@YaoYingLong

Copy link
Copy Markdown
Contributor Author

@laurit Please help fix the code conflicts and review the changes.

@opentelemetry-pr-dashboard

Copy link
Copy Markdown

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.

Comment thread settings.gradle.kts Outdated

@jaydeluca jaydeluca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to fix the failing "Metadata Validation Check" in CI, you will need to update the locations of the gradle tasks in this file

Comment thread .github/scripts/instrumentations.sh Outdated
@YaoYingLong

Copy link
Copy Markdown
Contributor Author

@laurit @jaydeluca Hi both, kindly re-review and advise if any changes are needed.

@jaydeluca

Copy link
Copy Markdown
Member

@YaoYingLong can you resolve the merge conflicts?

@YaoYingLong

Copy link
Copy Markdown
Contributor Author

@YaoYingLong can you resolve the merge conflicts?

@jaydeluca Fix merge conflicts and complete batchSize feature.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 39 changed files in this pull request and generated 4 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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] OpenTelemetryCallUtil is listed in HbaseInstrumentationModule.injectedClassNames(), so it will be defined in the instrumented library’s class loader. In that context it cannot reference agent-only types like io.opentelemetry.javaagent.instrumentation.hbase.client.common.RequestAndContext (field generic + RequestAndContext.class literal), 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.

Comment thread instrumentation/hbase/hbase-client-1.4/javaagent/build.gradle.kts
Comment thread instrumentation/hbase/hbase-client-1.4/javaagent/build.gradle.kts Outdated
Comment thread instrumentation/hbase/hbase-client-1.4/javaagent/build.gradle.kts Outdated
Comment thread instrumentation/hbase/hbase-client-2.0/javaagent/build.gradle.kts Outdated
@trask trask merged commit 805db77 into open-telemetry:main Jul 15, 2026
101 checks passed
@otelbot

otelbot Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants