kamon-scala


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

io.kamon
ArtifactId

ArtifactId

kamon-scala_2.10
Last Version

Last Version

1.0.0-RC1
Release Date

Release Date

Type

Type

jar
Description

Description

kamon-scala
kamon-scala
Project URL

Project URL

http://kamon.io
Project Organization

Project Organization

io.kamon

Download kamon-scala_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/io.kamon/kamon-scala_2.10/ -->
<dependency>
    <groupId>io.kamon</groupId>
    <artifactId>kamon-scala_2.10</artifactId>
    <version>1.0.0-RC1</version>
</dependency>
// https://jarcasting.com/artifacts/io.kamon/kamon-scala_2.10/
implementation 'io.kamon:kamon-scala_2.10:1.0.0-RC1'
// https://jarcasting.com/artifacts/io.kamon/kamon-scala_2.10/
implementation ("io.kamon:kamon-scala_2.10:1.0.0-RC1")
'io.kamon:kamon-scala_2.10:jar:1.0.0-RC1'
<dependency org="io.kamon" name="kamon-scala_2.10" rev="1.0.0-RC1">
  <artifact name="kamon-scala_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.kamon', module='kamon-scala_2.10', version='1.0.0-RC1')
)
libraryDependencies += "io.kamon" % "kamon-scala_2.10" % "1.0.0-RC1"
[io.kamon/kamon-scala_2.10 "1.0.0-RC1"]

Dependencies

compile (5)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.6
io.kamon : kamon-core_2.10 jar 1.0.0-RC1
io.kamon : kamon-testkit_2.10 jar 1.0.0-RC1
org.scalaz : scalaz-concurrent_2.10 Optional jar 7.2.8
com.twitter : util-core_2.10 Optional jar 6.34.0

provided (1)

Group / Artifact Type Version
org.aspectj : aspectjweaver jar 1.8.10

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 3.0.1
ch.qos.logback : logback-classic jar 1.0.13

Project Modules

There are no modules declared in this project.

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.

io.kamon

Kamon Open Source Project

Tools for monitoring applications running on the JVM

Versions

Version
1.0.0-RC1
0.6.7
0.6.6
0.6.5
0.6.3
0.6.2
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.0