You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/02/25 09:44:47 UTC

[GitHub] [hbase] ramkrish86 commented on a change in pull request #1202: HBASE-23756. [OpenTracing] Add OpenTracing dependency and helper methods.

ramkrish86 commented on a change in pull request #1202: HBASE-23756. [OpenTracing] Add OpenTracing dependency and helper methods.
URL: https://github.com/apache/hbase/pull/1202#discussion_r383765241
 
 

 ##########
 File path: hbase-common/src/main/java/org/apache/hadoop/hbase/trace/TraceUtil.java
 ##########
 @@ -34,17 +51,24 @@
   private static HTraceConfiguration conf;
   private static Tracer tracer;
 
+  private static io.opentracing.Tracer otTracer;
+
+  private static final Logger LOG = LoggerFactory.getLogger(TraceUtil.class.getName());
+
+
   private TraceUtil() {
   }
 
-  public static void initTracer(Configuration c) {
-    if (c != null) {
-      conf = new HBaseHTraceConfiguration(c);
-    }
+  public static void initTracer(Configuration c, String serviceName) {
+    if (!GlobalTracer.isRegistered()) {
+      io.jaegertracing.Configuration conf = io.jaegertracing.Configuration.fromEnv(serviceName);
+      io.opentracing.Tracer tracer = conf.getTracerBuilder().build();
 
-    if (tracer == null && conf != null) {
-      tracer = new Tracer.Builder("Tracer").conf(conf).build();
+      GlobalTracer.register(tracer);
 
 Review comment:
   More of a question  - This happens at the init time - means the server start up time right? If the user wants to use jaeger tracing he can do it by setting some env variables. But if the same has to be unset what needs to be done? And also after the server starts up and then he needs to introduce jaeger tracing how can that be done? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services