Jiri-Kremser 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_r123771600
##########
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)
Review comment:
actually, this doesn't work because
```scala
Option(GlobalTracer.isRegistered).exists(identity)
```
returns either `true` or `false` and I can't call map on Boolean
this works:
```scala
Option(GlobalTracer.isRegistered).flatMap(if (_) Option.empty else
Option(TracerResolver.resolveTracer))
```
but perhaps it's too much "flatmappy" :)
----------------------------------------------------------------
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