This is an automated email from the ASF dual-hosted git repository.
nihaljain pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-3 by this push:
new 0031421aa77 HBASE-29293 Upgrade to latest opentelemetry libraries
(#6969)
0031421aa77 is described below
commit 0031421aa77407d68e487f01f185a9075f5d2311
Author: Nihal Jain <[email protected]>
AuthorDate: Tue May 20 22:34:27 2025 +0530
HBASE-29293 Upgrade to latest opentelemetry libraries (#6969)
* Move from `io.opentelemetry:opentelemetry-semconv` to relocated groupid
`io.opentelemetry.semconv:opentelemetry-semconv` and change imports accordingly.
* Refactoring to keep all semantic attributes inside
`HBaseSemanticAttributes`
* Add appropriate excludes and includes for renamed groupid
`io.opentelemetry.semconv:opentelemetry-semconv` from
`io.opentelemetry:opentelemetry-semconv`
Signed-off-by: Istvan Toth <[email protected]>
Signed-off-by: Nick Dimiduk <[email protected]>
(cherry picked from commit 82a2ddf789d161877b3920decab9565f56e6aa4b)
---
.../src/main/assembly/hadoop-three-compat.xml | 2 ++
hbase-assembly/src/main/assembly/client.xml | 1 +
hbase-assembly/src/main/assembly/hadoop-three-compat.xml | 2 ++
.../hadoop/hbase/client/trace/hamcrest/SpanDataMatchers.java | 6 +++---
hbase-common/pom.xml | 2 +-
.../org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java | 6 +++++-
.../org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java | 2 +-
.../apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java | 8 ++++----
hbase-shaded/hbase-shaded-client/pom.xml | 1 +
hbase-shaded/hbase-shaded-testing-util/pom.xml | 1 +
hbase-shaded/pom.xml | 1 +
pom.xml | 9 +++++----
12 files changed, 27 insertions(+), 14 deletions(-)
diff --git
a/hbase-assembly-byo-hadoop/src/main/assembly/hadoop-three-compat.xml
b/hbase-assembly-byo-hadoop/src/main/assembly/hadoop-three-compat.xml
index 794d1db8517..bda8f6d5dc5 100644
--- a/hbase-assembly-byo-hadoop/src/main/assembly/hadoop-three-compat.xml
+++ b/hbase-assembly-byo-hadoop/src/main/assembly/hadoop-three-compat.xml
@@ -71,6 +71,7 @@
<exclude>org.slf4j:*</exclude>
<exclude>org.apache.logging.log4j:*</exclude>
<exclude>io.opentelemetry:*</exclude>
+ <exclude>io.opentelemetry.semconv:*</exclude>
<!-- Exclude the opentelemetry agent that goes in the lib/trace
directory -->
<exclude>io.opentelemetry.javaagent:*</exclude>
<!-- Exclude jline2 which goes into lib/zk-client. jline3 is a
different artifact-->
@@ -132,6 +133,7 @@
<include>org.slf4j:*</include>
<include>org.apache.logging.log4j:*</include>
<include>io.opentelemetry:*</include>
+ <include>io.opentelemetry.semconv:*</include>
</includes>
</dependencySet>
<dependencySet>
diff --git a/hbase-assembly/src/main/assembly/client.xml
b/hbase-assembly/src/main/assembly/client.xml
index f8708b363e6..d4a44e123a8 100644
--- a/hbase-assembly/src/main/assembly/client.xml
+++ b/hbase-assembly/src/main/assembly/client.xml
@@ -140,6 +140,7 @@
<include>org.slf4j:*</include>
<include>org.apache.logging.log4j:*</include>
<include>io.opentelemetry:*</include>
+ <include>io.opentelemetry.semconv:*</include>
</includes>
</dependencySet>
<dependencySet>
diff --git a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml
b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml
index 3fc5e0c7bd0..0a1fb04d8b3 100644
--- a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml
+++ b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml
@@ -72,6 +72,7 @@
<exclude>org.slf4j:*</exclude>
<exclude>org.apache.logging.log4j:*</exclude>
<exclude>io.opentelemetry:*</exclude>
+ <exclude>io.opentelemetry.semconv:*</exclude>
<!-- Exclude the opentelemetry agent that goes in the lib/trace
directory -->
<exclude>io.opentelemetry.javaagent:*</exclude>
<!-- Exclude jline2 which goes into lib/zk-client. jline3 is a
different artifact-->
@@ -133,6 +134,7 @@
<include>org.slf4j:*</include>
<include>org.apache.logging.log4j:*</include>
<include>io.opentelemetry:*</include>
+ <include>io.opentelemetry.semconv:*</include>
</includes>
</dependencySet>
<dependencySet>
diff --git
a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/trace/hamcrest/SpanDataMatchers.java
b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/trace/hamcrest/SpanDataMatchers.java
index d021f4d3aaf..2400c44a022 100644
---
a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/trace/hamcrest/SpanDataMatchers.java
+++
b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/trace/hamcrest/SpanDataMatchers.java
@@ -26,9 +26,9 @@ import io.opentelemetry.api.trace.SpanKind;
import io.opentelemetry.api.trace.StatusCode;
import io.opentelemetry.sdk.trace.data.EventData;
import io.opentelemetry.sdk.trace.data.SpanData;
-import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
import java.time.Duration;
import java.util.Objects;
+import org.apache.hadoop.hbase.trace.HBaseSemanticAttributes;
import org.hamcrest.Description;
import org.hamcrest.FeatureMatcher;
import org.hamcrest.Matcher;
@@ -87,7 +87,7 @@ public final class SpanDataMatchers {
}
public static Matcher<SpanData> hasExceptionWithType(Matcher<? super String>
matcher) {
- return hasException(containsEntry(is(SemanticAttributes.EXCEPTION_TYPE),
matcher));
+ return
hasException(containsEntry(is(HBaseSemanticAttributes.EXCEPTION_TYPE),
matcher));
}
public static Matcher<SpanData> hasException(Matcher<? super Attributes>
matcher) {
@@ -96,7 +96,7 @@ public final class SpanDataMatchers {
@Override
protected Attributes featureValueOf(SpanData actual) {
return actual.getEvents().stream()
- .filter(e -> Objects.equals(SemanticAttributes.EXCEPTION_EVENT_NAME,
e.getName()))
+ .filter(e ->
Objects.equals(HBaseSemanticAttributes.EXCEPTION_EVENT_NAME, e.getName()))
.map(EventData::getAttributes).findFirst().orElse(null);
}
};
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 0aecd4a471e..4b3ac15d4a2 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -103,7 +103,7 @@
<artifactId>opentelemetry-api</artifactId>
</dependency>
<dependency>
- <groupId>io.opentelemetry</groupId>
+ <groupId>io.opentelemetry.semconv</groupId>
<artifactId>opentelemetry-semconv</artifactId>
</dependency>
<dependency>
diff --git
a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java
index a629761b87b..da4fbba21d9 100644
---
a/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java
+++
b/hbase-common/src/main/java/org/apache/hadoop/hbase/trace/HBaseSemanticAttributes.java
@@ -18,7 +18,7 @@
package org.apache.hadoop.hbase.trace;
import io.opentelemetry.api.common.AttributeKey;
-import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
+import io.opentelemetry.semconv.SemanticAttributes;
import java.nio.ByteBuffer;
import java.util.List;
import org.apache.yetus.audience.InterfaceAudience;
@@ -57,6 +57,10 @@ public final class HBaseSemanticAttributes {
AttributeKey.booleanKey("db.hbase.rowlock.readlock");
public static final AttributeKey<String> WAL_IMPL =
AttributeKey.stringKey("db.hbase.wal.impl");
+ public static final AttributeKey<String> EXCEPTION_TYPE =
SemanticAttributes.EXCEPTION_TYPE;
+ public static final AttributeKey<String> EXCEPTION_MESSAGE =
SemanticAttributes.EXCEPTION_MESSAGE;
+ public static final String EXCEPTION_EVENT_NAME =
SemanticAttributes.EXCEPTION_EVENT_NAME;
+
/**
* Indicates the amount of data was read into a {@link ByteBuffer} of type
* {@link ByteBuffer#isDirect() direct}.
diff --git
a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
index 3179afd4682..555e9220728 100644
---
a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
+++
b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
@@ -856,7 +856,7 @@ public class TableMapReduceUtil {
com.codahale.metrics.MetricRegistry.class, // metrics-core
org.apache.commons.lang3.ArrayUtils.class, // commons-lang
io.opentelemetry.api.trace.Span.class, // opentelemetry-api
- io.opentelemetry.semconv.trace.attributes.SemanticAttributes.class, //
opentelemetry-semconv
+ io.opentelemetry.semconv.SemanticAttributes.class, //
opentelemetry-semconv
io.opentelemetry.context.Context.class); // opentelemetry-context
}
diff --git
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java
index 8bab83c8645..3797c5b5de5 100644
---
a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java
+++
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/AbstractTestAsyncTableScan.java
@@ -32,7 +32,6 @@ import static org.junit.Assert.assertThrows;
import static org.junit.Assert.fail;
import io.opentelemetry.sdk.trace.data.SpanData;
-import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Arrays;
@@ -55,6 +54,7 @@ import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.Waiter;
import org.apache.hadoop.hbase.ipc.RemoteWithExtrasException;
import org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException;
+import org.apache.hadoop.hbase.trace.HBaseSemanticAttributes;
import org.apache.hadoop.hbase.trace.OpenTelemetryClassRule;
import org.apache.hadoop.hbase.trace.OpenTelemetryTestRule;
import org.apache.hadoop.hbase.trace.TraceUtil;
@@ -283,12 +283,12 @@ public abstract class AbstractTestAsyncTableScan {
fail("Found unexpected Exception " + e);
}
assertTraceError(anyOf(
- containsEntry(is(SemanticAttributes.EXCEPTION_TYPE),
+ containsEntry(is(HBaseSemanticAttributes.EXCEPTION_TYPE),
endsWith(NoSuchColumnFamilyException.class.getName())),
allOf(
- containsEntry(is(SemanticAttributes.EXCEPTION_TYPE),
+ containsEntry(is(HBaseSemanticAttributes.EXCEPTION_TYPE),
endsWith(RemoteWithExtrasException.class.getName())),
- containsEntry(is(SemanticAttributes.EXCEPTION_MESSAGE),
+ containsEntry(is(HBaseSemanticAttributes.EXCEPTION_MESSAGE),
containsString(NoSuchColumnFamilyException.class.getName())))));
}
diff --git a/hbase-shaded/hbase-shaded-client/pom.xml
b/hbase-shaded/hbase-shaded-client/pom.xml
index 924eaf415ef..27a414efb1a 100644
--- a/hbase-shaded/hbase-shaded-client/pom.xml
+++ b/hbase-shaded/hbase-shaded-client/pom.xml
@@ -86,6 +86,7 @@
<exclude>commons-logging:*</exclude>
<exclude>org.javassist:*</exclude>
<exclude>io.opentelemetry:*</exclude>
+ <exclude>io.opentelemetry.semconv:*</exclude>
</excludes>
</artifactSet>
</configuration>
diff --git a/hbase-shaded/hbase-shaded-testing-util/pom.xml
b/hbase-shaded/hbase-shaded-testing-util/pom.xml
index b565a135667..6d574f526f5 100644
--- a/hbase-shaded/hbase-shaded-testing-util/pom.xml
+++ b/hbase-shaded/hbase-shaded-testing-util/pom.xml
@@ -130,6 +130,7 @@
<exclude>commons-logging:*</exclude>
<exclude>org.javassist:*</exclude>
<exclude>io.opentelemetry:*</exclude>
+ <exclude>io.opentelemetry.semconv:*</exclude>
</excludes>
</artifactSet>
</configuration>
diff --git a/hbase-shaded/pom.xml b/hbase-shaded/pom.xml
index 9dae4218cca..3ed84918a77 100644
--- a/hbase-shaded/pom.xml
+++ b/hbase-shaded/pom.xml
@@ -132,6 +132,7 @@
<exclude>commons-logging:*</exclude>
<exclude>org.javassist:*</exclude>
<exclude>io.opentelemetry:*</exclude>
+ <exclude>io.opentelemetry.semconv:*</exclude>
</excludes>
</artifactSet>
<relocations>
diff --git a/pom.xml b/pom.xml
index 2ffeedcbaed..784117d7793 100644
--- a/pom.xml
+++ b/pom.xml
@@ -845,8 +845,9 @@
<jruby.version>9.4.9.0</jruby.version>
<junit.version>4.13.2</junit.version>
<hamcrest.version>1.3</hamcrest.version>
- <opentelemetry.version>1.15.0</opentelemetry.version>
- <opentelemetry-javaagent.version>1.15.0</opentelemetry-javaagent.version>
+ <opentelemetry.version>1.49.0</opentelemetry.version>
+ <opentelemetry-semconv.version>1.29.0-alpha</opentelemetry-semconv.version>
+ <opentelemetry-javaagent.version>2.15.0</opentelemetry-javaagent.version>
<log4j2.version>2.17.2</log4j2.version>
<mockito.version>4.11.0</mockito.version>
<!--
@@ -1627,9 +1628,9 @@
<scope>import</scope>
</dependency>
<dependency>
- <groupId>io.opentelemetry</groupId>
+ <groupId>io.opentelemetry.semconv</groupId>
<artifactId>opentelemetry-semconv</artifactId>
- <version>${opentelemetry.version}-alpha</version>
+ <version>${opentelemetry-semconv.version}</version>
</dependency>
<dependency>
<groupId>io.opentelemetry.javaagent</groupId>