adriancole commented on a change in pull request #2282: Distributed tracing
support #2192
URL:
https://github.com/apache/incubator-openwhisk/pull/2282#discussion_r120270675
##########
File path: common/scala/src/main/scala/whisk/common/Logging.scala
##########
@@ -122,6 +138,45 @@ class PrintStreamLogging(outputStream: PrintStream =
Console.out) extends Loggin
}
/**
+ * Implementation of logging which also supports tracing using Zipkin.
+ * @param logger <code>Logging<code> instance which can do basic logging
+ */
+class ZipkinLogging (logger: Logging) extends Logging {
+
+ def emit(loglevel: LogLevel, id: TransactionId, from: AnyRef, message:
String) = {
+ logger.emit(loglevel, id, from, message)
+ }
+
+ override def emit(loglevel: LogLevel, id: TransactionId, from: AnyRef,
message: String, logMarker: LogMarker) = {
+
+ //log message as usual
+ emit(loglevel, id, from,
TransactionId.createMessageWithMarker(message, logMarker))
+
+ //tracing support
+ logMarker.token.state match {
Review comment:
clever!
----------------------------------------------------------------
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