jpkrohling commented on a change in pull request #2413: [wip] Draft 2 - Wrap 
runs within OpenTracing spans
URL: 
https://github.com/apache/incubator-openwhisk/pull/2413#discussion_r123667728
 
 

 ##########
 File path: 
core/invoker/src/main/scala/whisk/core/container/WhiskContainer.scala
 ##########
 @@ -92,17 +96,53 @@ class WhiskContainer(
     }
 
     /**
+     * Starts the tracing.
+     */
+    private def startSpan(msg: ActivationMessage): Option[Span] = {
+        val tracerOption = if (GlobalTracer.isRegistered) Option.empty else 
Some(TracerResolver.resolveTracer)
+        tracerOption foreach GlobalTracer.register
 
 Review comment:
   It might be that `tracerOption` is null at this point:
   
   https://travis-ci.org/apache/incubator-openwhisk/builds/245871954#L6909-L6913
   ```
       java.lang.NullPointerException: Cannot register GlobalTracer <null>.
           at io.opentracing.util.GlobalTracer.register(GlobalTracer.java:83)
           at 
whisk.core.container.WhiskContainer$$anonfun$startSpan$1.apply(WhiskContainer.scala:104)
           at 
whisk.core.container.WhiskContainer$$anonfun$startSpan$1.apply(WhiskContainer.scala:104)
           at scala.Option.foreach(Option.scala:257)
   ```
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to