[hbase] 03/18: HBASE-26126 Backport HBASE-25424 "Find a way to config OpenTelemetry tracing without directly depending on opentelemetry-sdk" to branch-2 (#3552)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch branch-2 in repository https://gitbox.apache.org/repos/asf/hbase.git commit af460132c09964e1ea2ff858182ef662ee973bc9 Author: Tak Lon (Stephen) Wu AuthorDate: Tue Aug 3 09:54:37 2021 -0700 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 Signed-off-by: Peter Somogyi --- bin/hbase| 10 ++ conf/hbase-env.sh| 5 + hbase-assembly/pom.xml | 6 ++ hbase-assembly/src/main/assembly/hadoop-three-compat.xml | 7 +++ pom.xml | 7 +++ 5 files changed, 35 insertions(+) diff --git a/bin/hbase b/bin/hbase index 496ebe1..5f3b326 100755 --- a/bin/hbase +++ b/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: diff --git a/conf/hbase-env.sh b/conf/hbase-env.sh index 6cc16d8..b3c4baf 100644 --- a/conf/hbase-env.sh +++ b/conf/hbase-env.sh @@ -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" diff --git a/hbase-assembly/pom.xml b/hbase-assembly/pom.xml index 451e9f3..4ea650d 100644 --- a/hbase-assembly/pom.xml +++ b/hbase-assembly/pom.xml @@ -339,6 +339,12 @@ log4j log4j + + + io.opentelemetry.javaagent + opentelemetry-javaagent + all + diff --git a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml index e5422f3..9780444 100644 --- a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml +++ b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml @@ -112,6 +112,7 @@ org.apache.yetus:audience-annotations org.slf4j:slf4j-api org.slf4j:slf4j-log4j12 + io.opentelemetry.javaagent:* @@ -256,6 +257,12 @@ jakarta.jws:jakarta.jws-api + + lib/trace + +io.opentelemetry.javaagent:* + + diff --git a/pom.xml b/pom.xml index 8cf9b02..95bb712 100755 --- a/pom.xml +++ b/pom.xml @@ -1484,6 +1484,7 @@ 4.13 1.3 0.13.1 + 0.13.0 1.2.17 2.28.2 @@ -2190,6 +2191,12 @@ ${opentelemetry.version} +io.opentelemetry.javaagent +opentelemetry-javaagent +${opentelemetry-instrumentation.version} +all + + com.lmax disruptor ${disruptor.version}
[hbase] 03/18: HBASE-26126 Backport HBASE-25424 "Find a way to config OpenTelemetry tracing without directly depending on opentelemetry-sdk" to branch-2 (#3552)
This is an automated email from the ASF dual-hosted git repository. taklwu pushed a commit to branch HBASE-25853 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 350288e9820dec32acfaf890a7fd3f93b42ac47a Author: Tak Lon (Stephen) Wu AuthorDate: Tue Aug 3 09:54:37 2021 -0700 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 Signed-off-by: Peter Somogyi --- bin/hbase| 10 ++ conf/hbase-env.sh| 5 + hbase-assembly/pom.xml | 6 ++ hbase-assembly/src/main/assembly/hadoop-three-compat.xml | 7 +++ pom.xml | 7 +++ 5 files changed, 35 insertions(+) diff --git a/bin/hbase b/bin/hbase index 496ebe1..5f3b326 100755 --- a/bin/hbase +++ b/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: diff --git a/conf/hbase-env.sh b/conf/hbase-env.sh index 6cc16d8..b3c4baf 100644 --- a/conf/hbase-env.sh +++ b/conf/hbase-env.sh @@ -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" diff --git a/hbase-assembly/pom.xml b/hbase-assembly/pom.xml index 451e9f3..4ea650d 100644 --- a/hbase-assembly/pom.xml +++ b/hbase-assembly/pom.xml @@ -339,6 +339,12 @@ log4j log4j + + + io.opentelemetry.javaagent + opentelemetry-javaagent + all + diff --git a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml index e5422f3..9780444 100644 --- a/hbase-assembly/src/main/assembly/hadoop-three-compat.xml +++ b/hbase-assembly/src/main/assembly/hadoop-three-compat.xml @@ -112,6 +112,7 @@ org.apache.yetus:audience-annotations org.slf4j:slf4j-api org.slf4j:slf4j-log4j12 + io.opentelemetry.javaagent:* @@ -256,6 +257,12 @@ jakarta.jws:jakarta.jws-api + + lib/trace + +io.opentelemetry.javaagent:* + + diff --git a/pom.xml b/pom.xml index 77d12ac..75b3c58 100755 --- a/pom.xml +++ b/pom.xml @@ -1483,6 +1483,7 @@ 4.13 1.3 0.13.1 + 0.13.0 1.2.17 2.28.2 @@ -2189,6 +2190,12 @@ ${opentelemetry.version} +io.opentelemetry.javaagent +opentelemetry-javaagent +${opentelemetry-instrumentation.version} +all + + com.lmax disruptor ${disruptor.version}