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 |
| import javax.annotation.Nullable; | ||
| import org.apache.hadoop.hbase.TableName; | ||
|
|
||
| public final class HbaseClientState { |
| import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; | ||
| import io.opentelemetry.instrumentation.api.instrumenter.SpanKindExtractor; | ||
|
|
||
| public final class HbaseInstrumenterFactory { |
|
@laurit Please help fix the code conflicts and review the changes. |
Add support for HBase versions [1.4.0, 2.0.0)