HBASE-26126 Backport HBASE-25424 "Find a way to config OpenTelemetry tracing without directly depending on opentelemetry-sdk" to branch-2 (#3552)
3/17 commits of HBASE-22120, original commit#57960fa8fa7228d65b1a4adc8e9b5b1a8158824d Co-authored-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Peter Somogyi <psomogyi@apache.org>
This commit is contained in:
parent
4dfc59c19e
commit
af460132c0
10
bin/hbase
10
bin/hbase
|
@ -487,6 +487,11 @@ add_jdk11_deps_to_classpath() {
|
|||
done
|
||||
}
|
||||
|
||||
enable_trace() {
|
||||
agent_jar=$(find lib/trace -type f -name "opentelemetry-javaagent-*")
|
||||
HBASE_OPTS="$HBASE_OPTS -javaagent:$agent_jar $HBASE_TRACE_OPTS"
|
||||
}
|
||||
|
||||
#Add the development env class path stuff
|
||||
if $in_dev_env; then
|
||||
add_maven_deps_to_classpath "cached_classpath.txt"
|
||||
|
@ -764,6 +769,11 @@ elif [ "${DEBUG}" = "true" ]; then
|
|||
echo "JDK11 jars skipped from classpath."
|
||||
fi
|
||||
|
||||
if [[ -n "${HBASE_TRACE_OPTS}" ]]; then
|
||||
echo "Attach opentelemetry agent to enable trace"
|
||||
enable_trace
|
||||
fi
|
||||
|
||||
# Have JVM dump heap if we run out of memory. Files will be 'launch directory'
|
||||
# and are named like the following: java_pid21612.hprof. Apparently it doesn't
|
||||
# 'cost' to have this flag enabled. Its a 1.6 flag only. See:
|
||||
|
|
|
@ -144,3 +144,8 @@
|
|||
|
||||
# Additional argments passed to jshell invocation
|
||||
# export HBASE_JSHELL_ARGS="--startup DEFAULT --startup PRINTING --startup hbase_startup.jsh"
|
||||
|
||||
# Uncomment to enable trace, you can change the options to use other exporters such as jaeger or
|
||||
# zipkin. See https://github.com/open-telemetry/opentelemetry-java-instrumentation on how to config
|
||||
# exporters and other components through system properties.
|
||||
# export HBASE_TRACE_OPTS="-Dotel.config.sampler.probability=0.1 -Dotel.exporter=logging"
|
||||
|
|
|
@ -339,6 +339,12 @@
|
|||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</dependency>
|
||||
<!-- Include OpenTelemetry agent -->
|
||||
<dependency>
|
||||
<groupId>io.opentelemetry.javaagent</groupId>
|
||||
<artifactId>opentelemetry-javaagent</artifactId>
|
||||
<classifier>all</classifier>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<profiles>
|
||||
<profile>
|
||||
|
|
|
@ -112,6 +112,7 @@
|
|||
<exclude>org.apache.yetus:audience-annotations</exclude>
|
||||
<exclude>org.slf4j:slf4j-api</exclude>
|
||||
<exclude>org.slf4j:slf4j-log4j12</exclude>
|
||||
<exclude>io.opentelemetry.javaagent:*</exclude>
|
||||
</excludes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
|
@ -256,6 +257,12 @@
|
|||
<include>jakarta.jws:jakarta.jws-api</include>
|
||||
</includes>
|
||||
</dependencySet>
|
||||
<dependencySet>
|
||||
<outputDirectory>lib/trace</outputDirectory>
|
||||
<includes>
|
||||
<include>io.opentelemetry.javaagent:*</include>
|
||||
</includes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
|
||||
</assembly>
|
||||
|
|
7
pom.xml
7
pom.xml
|
@ -1484,6 +1484,7 @@
|
|||
<junit.version>4.13</junit.version>
|
||||
<hamcrest.version>1.3</hamcrest.version>
|
||||
<opentelemetry.version>0.13.1</opentelemetry.version>
|
||||
<opentelemetry-instrumentation.version>0.13.0</opentelemetry-instrumentation.version>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<mockito-core.version>2.28.2</mockito-core.version>
|
||||
<!--Internally we use a different version of protobuf. See hbase-protocol-shaded-->
|
||||
|
@ -2189,6 +2190,12 @@
|
|||
<artifactId>opentelemetry-sdk-testing</artifactId>
|
||||
<version>${opentelemetry.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.opentelemetry.javaagent</groupId>
|
||||
<artifactId>opentelemetry-javaagent</artifactId>
|
||||
<version>${opentelemetry-instrumentation.version}</version>
|
||||
<classifier>all</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lmax</groupId>
|
||||
<artifactId>disruptor</artifactId>
|
||||
|
|
Loading…
Reference in New Issue