kamon-io / Kamon

Distributed Tracing, Metrics and Context Propagation for applications running on the JVM
https://kamon.io
Other
1.41k stars 327 forks source link

Add cardamo/play-logback-access to instrumentation whitelist #647

Open dominics opened 5 years ago

dominics commented 5 years ago

play-logback-access project

It'd be good to add org.databrary.logback..* to the instrumentation within, to prevent errors such as:

[error] akka.dispatch.Dispatcher api-akka.actor.default-dispatcher-23 traceId=27f332fc950f016e - org.databrary.logback.PlayAccessEvent cannot be cast to kamon.instrumentation.context.HasContext
java.lang.ClassCastException: org.databrary.logback.PlayAccessEvent cannot be cast to kamon.instrumentation.context.HasContext
    at kamon.instrumentation.logback.AppendLoopMethodInterceptor$.aroundAppendLoop(LogbackInstrumentation.scala:83)
    at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java)
    at org.databrary.PlayLogbackAccess.log(plugin.scala:43)
[...]

Not sure how popular cardamo/play-logback-access is, or how popular a package should be to be added to the default within

ctoomey commented 3 years ago

I've run into this issue too -- is there a config. setting or other workaround to prevent this?

ctoomey commented 3 years ago

FYI I worked around it by not installing kamon-bundle, which automatically includes logback as well as a bunch of other instrumentations. Instead I install only the kamon-* packages I need.

SimunKaracic commented 3 years ago

One workaround would have been to disable the logback module if you're not using it: kanela.modules.logback.enabled = false.

You can also add the within block, so Kamon knows where to look for the PlayAccessEvent: kanela.modules.logback.within = ["org.databrary.logback..*"]

Not sure how popular cardamo/play-logback-access is, or how popular a package should be to be added to the default within

It doesn't seem to be too popular, so we'll refrain from adding it for now, if some more people come across the same error, we'll add it to the configuration