File tree Expand file tree Collapse file tree 5 files changed +35
-0
lines changed Expand file tree Collapse file tree 5 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -487,6 +487,11 @@ add_jdk11_deps_to_classpath() {
487
487
done
488
488
}
489
489
490
+ enable_trace () {
491
+ agent_jar=$( find lib/trace -type f -name " opentelemetry-javaagent-*" )
492
+ HBASE_OPTS=" $HBASE_OPTS -javaagent:$agent_jar $HBASE_TRACE_OPTS "
493
+ }
494
+
490
495
# Add the development env class path stuff
491
496
if $in_dev_env ; then
492
497
add_maven_deps_to_classpath " cached_classpath.txt"
@@ -764,6 +769,11 @@ elif [ "${DEBUG}" = "true" ]; then
764
769
echo " JDK11 jars skipped from classpath."
765
770
fi
766
771
772
+ if [[ -n " ${HBASE_TRACE_OPTS} " ]]; then
773
+ echo " Attach opentelemetry agent to enable trace"
774
+ enable_trace
775
+ fi
776
+
767
777
# Have JVM dump heap if we run out of memory. Files will be 'launch directory'
768
778
# and are named like the following: java_pid21612.hprof. Apparently it doesn't
769
779
# 'cost' to have this flag enabled. Its a 1.6 flag only. See:
Original file line number Diff line number Diff line change 144
144
145
145
# Additional argments passed to jshell invocation
146
146
# export HBASE_JSHELL_ARGS="--startup DEFAULT --startup PRINTING --startup hbase_startup.jsh"
147
+
148
+ # Uncomment to enable trace, you can change the options to use other exporters such as jaeger or
149
+ # zipkin. See https://github.com/open-telemetry/opentelemetry-java-instrumentation on how to config
150
+ # exporters and other components through system properties.
151
+ # export HBASE_TRACE_OPTS="-Dotel.config.sampler.probability=0.1 -Dotel.exporter=logging"
Original file line number Diff line number Diff line change 339
339
<groupId >log4j</groupId >
340
340
<artifactId >log4j</artifactId >
341
341
</dependency >
342
+ <!-- Include OpenTelemetry agent -->
343
+ <dependency >
344
+ <groupId >io.opentelemetry.javaagent</groupId >
345
+ <artifactId >opentelemetry-javaagent</artifactId >
346
+ <classifier >all</classifier >
347
+ </dependency >
342
348
</dependencies >
343
349
<profiles >
344
350
<profile >
Original file line number Diff line number Diff line change 112
112
<exclude >org.apache.yetus:audience-annotations</exclude >
113
113
<exclude >org.slf4j:slf4j-api</exclude >
114
114
<exclude >org.slf4j:slf4j-log4j12</exclude >
115
+ <exclude >io.opentelemetry.javaagent:*</exclude >
115
116
</excludes >
116
117
</dependencySet >
117
118
</dependencySets >
256
257
<include >jakarta.jws:jakarta.jws-api</include >
257
258
</includes >
258
259
</dependencySet >
260
+ <dependencySet >
261
+ <outputDirectory >lib/trace</outputDirectory >
262
+ <includes >
263
+ <include >io.opentelemetry.javaagent:*</include >
264
+ </includes >
265
+ </dependencySet >
259
266
</dependencySets >
260
267
261
268
</assembly >
Original file line number Diff line number Diff line change 1483
1483
<junit .version>4.13</junit .version>
1484
1484
<hamcrest .version>1.3</hamcrest .version>
1485
1485
<opentelemetry .version>0.13.1</opentelemetry .version>
1486
+ <opentelemetry-instrumentation .version>0.13.0</opentelemetry-instrumentation .version>
1486
1487
<log4j .version>1.2.17</log4j .version>
1487
1488
<mockito-core .version>2.28.2</mockito-core .version>
1488
1489
<!-- Internally we use a different version of protobuf. See hbase-protocol-shaded-->
2188
2189
<artifactId >opentelemetry-sdk-testing</artifactId >
2189
2190
<version >${opentelemetry.version} </version >
2190
2191
</dependency >
2192
+ <dependency >
2193
+ <groupId >io.opentelemetry.javaagent</groupId >
2194
+ <artifactId >opentelemetry-javaagent</artifactId >
2195
+ <version >${opentelemetry-instrumentation.version} </version >
2196
+ <classifier >all</classifier >
2197
+ </dependency >
2191
2198
<dependency >
2192
2199
<groupId >com.lmax</groupId >
2193
2200
<artifactId >disruptor</artifactId >
You can’t perform that action at this time.
0 commit comments