Giter VIP home page Giter VIP logo

Comments (7)

coding4cc avatar coding4cc commented on July 22, 2024

Still not work with
kamon 2.6.6
kanela-agent 1.0.18

from kamon.

hughsimpson avatar hughsimpson commented on July 22, 2024

@coding4cc That exact same example works fine for me with kamon 2.6.6 and kanela-agent 1.0.18. Are you able to provide a minimum reproduction in a repo?

from kamon.

coding4cc avatar coding4cc commented on July 22, 2024

@hughsimpson
java version "1.8.0_361"
scala version "2.13.12"
kamon "2.6.6"
kanela-agent "1.0.18"

object KamonSpec extends App {

  val system = ActorSystem("ac")

  import system.dispatcher

  Kamon.init()

  Kamon.runWithContext(kamon.context.Context.of("foo", "bar")){
    for {
      _ <- Future.successful("biz")
      _ = println(s"In future context hashcode: ${Kamon.currentContext().hashCode()}, tags: ${Kamon.currentContext().tags}")
    } yield {
      println(s"In yield context hashcode: ${Kamon.currentContext().hashCode()}, tags: ${Kamon.currentContext().tags}")
    }
  }
}

output

In future context hashcode: 1591975262, tags: {}
In yield context hashcode: 1591975262, tags: {}

from kamon.

hughsimpson avatar hughsimpson commented on July 22, 2024

Again, this is working for me. It's likely something else in your env has changed -- for example, if running with sbt run, have you set fork := true? Here're the build files I'm using to attempt to reproduce:
build.sbt:

enablePlugins(JavaAgent)
scalaVersion := "2.13.12"
libraryDependencies ++= Seq(
  "io.kamon" %% "kamon-bundle" % "2.7.0",
  "com.typesafe.akka" %% "akka-actor" % "2.6.21"
)
javaAgents += "io.kamon" % "kanela-agent" % "1.0.18"
fork := true

project/plugins.sbt:

addSbtPlugin("io.kamon" % "sbt-kanela-runner" % "2.0.14")
addSbtPlugin("com.github.sbt" % "sbt-javaagent" % "0.1.8")

Tested with several versions of java (21.0.1-graalce, 21.0.1-zulu, 17.0.9-zulu, 8.0.392-zulu), and I'm unable to reproduce your issue, so I believe it must be configuration-related...

from kamon.

hughsimpson avatar hughsimpson commented on July 22, 2024

@coding4cc are you able to help narrow this down? Is there a discrepancy between your build config and the one I provided that might account for what you're seeing?

from kamon.

nikolaiser avatar nikolaiser commented on July 22, 2024

Not sure it is 100% related to this issue, but we faced a similar problem and managed to fix it by adding the following section in our application.conf

 kanela.modules.executor-service.within = [
      "scala.concurrent..*"
   ]

from kamon.

coding4cc avatar coding4cc commented on July 22, 2024

Not sure it is 100% related to this issue, but we faced a similar problem and managed to fix it by adding the following section in our application.conf

 kanela.modules.executor-service.within = [
      "scala.concurrent..*"
   ]

Works for me! Thanks

from kamon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.