kamon-scala

Kamon Scala整合。(Kamon Scala Integration)

  • 所有者: kamon-io/kamon-scala
  • 平台: Linux, Mac, Solaris, Windows
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Scala Integration

Build Status
Gitter
Maven Central

Getting Started

Kamon scala module is currently available for Scala 2.10, 2.11 and 2.12.

Supported releases and dependencies are shown below., kamon-scala, status, jdk, scala, akka, :------:, :------:, :----:, ------------------, :------:, 0.6.7, stable, 1.7+, 1.8+, 2.10, 2.11, 2.12, 2.3.x, 2.4.x, To get started with SBT, simply add the following to your build.sbt
file:

libraryDependencies += "io.kamon" %% "kamon-scala" % "0.6.7"

Automatic TraceContext Propagation with Futures

The kamon-scala module provides bytecode instrumentation for both Scala, Scalaz and Twitter Futures that automatically
propagates the TraceContext across the asynchronous operations that might be scheduled for a given Future.

The kamon-scala module require you to start your application using the AspectJ Weaver Agent. Kamon will warn you
at startup if you failed to do so.

Future's Body and Callbacks

In the following piece of code, the body of the future will be executed asynchronously on some other thread provided by
the ExecutionContext available in implicit scope, but Kamon will capture the TraceContext available when the future
was created and make it available while executing the future's body.

Tracer.withNewContext("sample-trace") {
    // The same TraceContext available here,

    Future {
      // is available here as well.
      "Hello Kamon"

    }.map(_.length)
      .flatMap(len => Future(len.toString))
      .map(s => Tracer.currentContext)
      .map(println)
      // And through all async callbacks, even while
      // they are executed at different threads!
  }

Also, when you transform a future by using map/flatMap/filter and friends or you directly register a
onComplete/onSuccess/onFailure callback on a future, Kamon will capture the TraceContext available when transforming
the future and make it available when executing the given callback. The code snippet above would print the same
TraceContext that was available when creating the future, during it's body execution and during the execution of all
the asynchronous operations scheduled on it.

主要指標

概覽
名稱與所有者kamon-io/kamon-scala
主編程語言Scala
編程語言Scala (語言數: 2)
平台Linux, Mac, Solaris, Windows
許可證Other
所有者活动
創建於2016-11-28 21:48:55
推送於2017-11-23 01:24:25
最后一次提交2017-06-07 15:06:56
發布數5
最新版本名稱v1.0.0-RC4 (發布於 )
第一版名稱v0.6.5 (發布於 2016-12-31 14:59:41)
用户参与
星數5
關注者數2
派生數5
提交數28
已啟用問題?
問題數2
打開的問題數0
拉請求數4
打開的拉請求數0
關閉的拉請求數2
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?