Skip to content

Elementary Akka Setup Example #896

Answered by tupol
tupol asked this question in Q&A
Discussion options

You must be logged in to vote

With the kind help from @ivantopo we found the following solution:

  • add kamon.trace.sampler="always" to the kamon configuration
  • since the project is only about actors, it seems that actors do not start spans by themselves, but just participate in a span, so I had to wrap the actor interaction with Kamon.runWithSpan(span) { ... } to trigger the span creation.
    In the end the AkkaQuickstart class looked like
object AkkaQuickstart extends App {
  Kamon.init()
  val greeterMain: ActorSystem[GreeterMain.SayHello] = ActorSystem(GreeterMain(), "AkkaQuickStart")
  Kamon.runWithSpan(Kamon.serverSpanBuilder("operation-name", "component-name").start()) {
    greeterMain ! SayHello("Charles")
  }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tupol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant