Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
750e307
feat: Add support for HBase versions 2.0.0 to 2.5.0.
YaoYingLong Apr 24, 2026
6772032
Merge branch 'main' into feature/hbase-2.0.0
YaoYingLong Apr 24, 2026
85e0cff
feat: Code review issue optimization and repeated test code merging.
YaoYingLong Apr 24, 2026
074d553
Merge branch 'main' into feature/hbase-2.0.0
YaoYingLong Apr 26, 2026
df40828
Merge branch 'main' into feature/hbase-2.0.0
trask May 2, 2026
4101651
fix: Fix the bug causing the failed check
YaoYingLong May 12, 2026
bf11f65
Fix: spotlessJavaCheck execution failure
YaoYingLong May 13, 2026
dcd7d0b
Fix: Fix the issue where VirtualField has an overly broad scope.
YaoYingLong May 13, 2026
9b3fd85
feat: Optimize code review issues
YaoYingLong May 22, 2026
334e01c
Merge branch 'main' into feature/hbase-2.0.0
YaoYingLong May 22, 2026
bfba82a
fix: Fix fossa‑configuration‑check failure
YaoYingLong May 22, 2026
1c9ef26
Merge remote-tracking branch 'origin/feature/hbase-2.0.0' into featur…
YaoYingLong May 22, 2026
79d54f2
fix: remove :instrumentation:hbase:hbase-common:javaagent from .fossa…
YaoYingLong May 25, 2026
0408afc
feat: Optimize code comments
YaoYingLong May 26, 2026
d07b69b
fix: document HBase latest dep test override
YaoYingLong May 27, 2026
e66dbf4
Merge branch 'main' into feature/hbase-2.0.0
laurit Jun 2, 2026
09ace1f
review
laurit Jun 2, 2026
4500547
Move shaded client tests into a suite
laurit Jun 3, 2026
9ca8321
feat: Optimize test cases
YaoYingLong Jun 5, 2026
9f4b364
fix: Resolve Spotless task execution failure
YaoYingLong Jun 5, 2026
e5948f7
review
laurit Jun 5, 2026
4412291
flatten directory hierarchy
laurit Jun 5, 2026
1d920c9
update fossa configuration
laurit Jun 5, 2026
df69aa0
Merge branch 'open-telemetry:main' into feature/hbase-2.0.0
YaoYingLong Jun 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ targets:
- type: gradle
path: ./
target: ':instrumentation:gwt-2.0:javaagent'
- type: gradle
path: ./
target: ':instrumentation:hbase-client-2.0:javaagent'
- type: gradle
path: ./
target: ':instrumentation:helidon-4.3:javaagent'
Expand Down
4 changes: 4 additions & 0 deletions .github/config/latest-dep-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@
"org.apache.dubbo:dubbo#+": "3.3.6",
"org.apache.dubbo:dubbo-config-api#+": "3.3.6",
"org.apache.geode:geode-core#+": "2.0.2",
"org.apache.hbase:hbase-client#+": "2.6.5",
"org.apache.hbase:hbase-client#2.4.+": "2.4.18",
"org.apache.hbase:hbase-shaded-client#+": "2.4.18",
"org.apache.hbase:hbase-shaded-client#2.4.+": "2.4.18",
"org.apache.httpcomponents.client5:httpclient5#+": "5.6.1",
"org.apache.httpcomponents:httpasyncclient#+": "4.1.5",
"org.apache.httpcomponents:httpclient#+": "4.5.14",
Expand Down
3 changes: 2 additions & 1 deletion docs/supported-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ These are the supported libraries and frameworks:
| [Apache DBCP](https://commons.apache.org/proper/commons-dbcp/) | 2.0+ | [opentelemetry-apache-dbcp-2.0](../instrumentation/apache-dbcp-2.0/library) | [Database Pool Metrics] |
| [Apache Dubbo](https://github.com/apache/dubbo/) | 2.7+ | [opentelemetry-apache-dubbo-2.7](../instrumentation/apache-dubbo-2.7/library-autoconfigure) | [RPC Client Spans], [RPC Server Spans] |
| [Apache ElasticJob](https://shardingsphere.apache.org/elasticjob/) | 3.0+ | N/A | none |
| [Apache HBase](https://hbase.apache.org/) | 2.0 - 2.4.x | N/A | [Database Client Spans], [Database Client Metrics] [6] |
| [Apache HttpAsyncClient](https://hc.apache.org/index.html) | 4.1+ | N/A | [HTTP Client Spans], [HTTP Client Metrics] |
| [Apache HttpClient](https://hc.apache.org/index.html) | 2.0+ | [opentelemetry-apache-httpclient-4.3](../instrumentation/apache-httpclient/apache-httpclient-4.3/library),<br>[opentelemetry-apache-httpclient-5.2](../instrumentation/apache-httpclient/apache-httpclient-5.2/library) | [HTTP Client Spans], [HTTP Client Metrics] |
| [Apache Iceberg](https://iceberg.apache.org/) | N/A | [opentelemetry-iceberg-1.8](../instrumentation/iceberg-1.8/library/) | none |
Expand All @@ -44,7 +45,7 @@ These are the supported libraries and frameworks:
| [Apache RocketMQ gRPC/Protobuf-based Client](https://rocketmq.apache.org/) | 5.0+ | N/A | [Messaging Spans] |
| [Apache RocketMQ Remoting-based Client](https://rocketmq.apache.org/) | 4.8+ | [opentelemetry-rocketmq-client-4.8](../instrumentation/rocketmq/rocketmq-client-4.8/library) | [Messaging Spans] |
| [Apache Struts](https://github.com/apache/struts) | 2.3+ | N/A | Provides `http.route` [2], Controller Spans [3] |
| [Apache Thrift](https://thrift.apache.org/) | 0.13+ | [opentelemetry-thrift-0.13](../instrumentation/thrift-0.13/library) | [RPC Client Spans], [RPC Client Metrics], [RPC Server Spans], [RPC Server Metrics] |
| [Apache Thrift](https://thrift.apache.org/) | 0.13+ | [opentelemetry-thrift-0.13](../instrumentation/thrift-0.13/library) | [RPC Client Spans], [RPC Client Metrics], [RPC Server Spans], [RPC Server Metrics] |
| [Apache Tapestry](https://tapestry.apache.org/) | 5.4+ | N/A | Provides `http.route` [2], Controller Spans [3] |
| [Apache Wicket](https://wicket.apache.org/) | 8.0+ | N/A | Provides `http.route` [2] |
| [Armeria](https://armeria.dev) | 1.3+ | [opentelemetry-armeria-1.3](../instrumentation/armeria/armeria-1.3/library) | [HTTP Client Spans], [HTTP Client Metrics], [HTTP Server Spans], [HTTP Server Metrics] |
Expand Down
75 changes: 75 additions & 0 deletions instrumentation/hbase-client-2.0/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
plugins {
id("otel.javaagent-instrumentation")
}

otelJava {
// HBase 2.0.x test stack is not reliable on JDK 25+.
maxJavaVersionForTests.set(JavaVersion.VERSION_24)
}

muzzle {
pass {
group.set("org.apache.hbase")
module.set("hbase-client")
versions.set("[2.0.0, 2.5.0)")
assertInverse.set(true)
}
}

dependencies {
library("org.apache.hbase:hbase-client:2.0.0")

compileOnly("com.google.auto.value:auto-value-annotations")
annotationProcessor("com.google.auto.value:auto-value")

testImplementation(project(":instrumentation:hbase-client-2.0:testing"))

latestDepTestLibrary("org.apache.hbase:hbase-client:2.4.+") // native on-by-default instrumentation after this version
}

testing {
suites {
val shadedClientTest by registering(JvmTestSuite::class) {
dependencies {
implementation("org.apache.hbase:hbase-shaded-client:${baseVersion("2.0.0").orLatest("2.4.+")}")
implementation(project(":instrumentation:hbase-client-2.0:testing"))
}
}
}
}

abstract class HbaseBuildService : BuildService<BuildServiceParameters.None>

// HBase test container binds fixed host ports, disallow running tests in parallel.
gradle.sharedServices.registerIfAbsent("hbaseBuildService", HbaseBuildService::class.java) {
maxParallelUsages.convention(1)
}

tasks {
withType<Test>().configureEach {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
usesService(gradle.sharedServices.registrations["hbaseBuildService"].service)
systemProperty("collectMetadata", otelProps.collectMetadata)
}

val stableSemconvSuites = testing.suites.withType(JvmTestSuite::class)
.map { suite ->
register<Test>("${suite.name}StableSemconv") {
testClassesDirs = suite.sources.output.classesDirs
classpath = suite.sources.runtimeClasspath

jvmArgs("-Dotel.semconv-stability.opt-in=database")
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database")
}
}

check {
dependsOn(testing.suites, stableSemconvSuites)
}

if (otelProps.denyUnsafe) {
withType<Test>().configureEach {
enabled = false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.hbase.client.v2_0;

import static io.opentelemetry.javaagent.instrumentation.hbase.client.v2_0.HbaseSingletons.getTableName;
import static io.opentelemetry.javaagent.instrumentation.hbase.client.v2_0.HbaseSingletons.instrumenter;
import static io.opentelemetry.javaagent.instrumentation.hbase.client.v2_0.HbaseSingletons.resetRequestAndContext;
import static io.opentelemetry.javaagent.instrumentation.hbase.client.v2_0.HbaseSingletons.setRequestAndContext;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;

import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import io.opentelemetry.javaagent.bootstrap.Java8BytecodeBridge;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
import java.net.InetSocketAddress;
import javax.annotation.Nullable;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
import org.apache.hadoop.hbase.net.Address;
import org.apache.hadoop.hbase.security.User;
import org.apache.hbase.thirdparty.com.google.protobuf.Descriptors;

class AbstractRpcClientInstrumentation implements TypeInstrumentation {

@Override
public ElementMatcher<TypeDescription> typeMatcher() {
return named("org.apache.hadoop.hbase.ipc.AbstractRpcClient");
}

@Override
public void transform(TypeTransformer transformer) {
transformer.applyAdviceToMethod(
named("callMethod")
.and(
takesArgument(
0,
named(
"org.apache.hbase.thirdparty.com.google.protobuf.Descriptors$MethodDescriptor")))
.and(takesArgument(4, named("org.apache.hadoop.hbase.security.User"))),
getClass().getName() + "$CallMethodAdvice");
}

@SuppressWarnings("unused")
public static class CallMethodAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
public static RequestAndContext onEnter(
@Advice.Argument(0) Descriptors.MethodDescriptor md,
@Advice.Argument(4) User ticket,
@Advice.Argument(5) Object addr) {
String hostname = null;
Integer port = null;
if (addr instanceof Address) {
Address address = (Address) addr;
port = address.getPort();
hostname = address.getHostname();
} else if (addr instanceof InetSocketAddress) {
InetSocketAddress address = (InetSocketAddress) addr;
port = address.getPort();
hostname = address.getHostString();
}
HbaseRequest request =
HbaseRequest.create(md.getName(), getTableName(), ticket.getName(), hostname, port);
Context parentContext = Java8BytecodeBridge.currentContext();
if (!instrumenter().shouldStart(parentContext, request)) {
return null;
}
Context context = instrumenter().start(parentContext, request);
Scope scope = context.makeCurrent();
RequestAndContext requestAndContext = RequestAndContext.create(request, scope, context);
setRequestAndContext(requestAndContext);
return requestAndContext;
}

@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
public static void onExit(
@Advice.Thrown Throwable throwable,
@Advice.Enter @Nullable RequestAndContext requestAndContext) {
resetRequestAndContext();
if (requestAndContext == null) {
return;
}

Scope scope = requestAndContext.getScope();
scope.close();

if (throwable != null) {
instrumenter()
.end(requestAndContext.getContext(), requestAndContext.getRequest(), null, throwable);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.hbase.client.v2_0;

import io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientAttributesGetter;
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DbSystemNameIncubatingValues;
import java.net.InetSocketAddress;
import javax.annotation.Nullable;

final class HbaseAttributesGetter implements DbClientAttributesGetter<HbaseRequest, Void> {

@Nullable
@Override
public String getDbSystemName(HbaseRequest hbaseRequest) {
return DbSystemNameIncubatingValues.HBASE;
}

@Nullable
@Override
public String getDbNamespace(HbaseRequest hbaseRequest) {
return hbaseRequest.getTable();
}

@Nullable
@Override
// Old database semconv still use db.user, so we must implement the deprecated hook.
@SuppressWarnings("deprecation")
public String getUser(HbaseRequest hbaseRequest) {
return hbaseRequest.getUser();
}

@Nullable
@Override
public String getDbQueryText(HbaseRequest hbaseRequest) {
return null;
}

@Nullable
@Override
public String getDbOperationName(HbaseRequest hbaseRequest) {
return hbaseRequest.getOperation();
}

@Nullable
@Override
public InetSocketAddress getNetworkPeerInetSocketAddress(
HbaseRequest request, @Nullable Void unused) {
if (request.getHost() == null || request.getPort() == null) {
return null;
}
return InetSocketAddress.createUnresolved(request.getHost(), request.getPort());
}

@Nullable
@Override
public String getServerAddress(HbaseRequest request) {
return request.getHost();
}

@Nullable
@Override
public Integer getServerPort(HbaseRequest request) {
return request.getPort();
}
}
Loading
Loading