Comments (9)
Thanks this was very helpful. I believe I've identified the issue and am working on a patched release - the sl4fj bug wasn't the only issue, although it was certainly the most visible side-effect. It seems that all the pekko dependencies were being pulled in transitively to the produced jar - this produced a funny situation where the 1.7.x slf4j LoggerFactory implementation was being used despite eviction, and broke implementations depending on the 2.x api. It also caused the kamon-bundle jar size to balloon tremendously. Releasing a patch under 2.6.5 now 🤞
from kamon.
Marking this as resolved now - testing with 2.6.5 shows this to be fixed
from kamon.
Exact same problem here
from kamon.
Same here. I'm using MDC, and my context variables always return null
. Looking at the code, there are some dependency issues. The log4j classes are present in the kammon-bundle
. I even tried to exclude the library but didn't work.
from kamon.
Welp this is unexpected. Let me have a look, and apologies - I was responsible for that release 😅
from kamon.
Nothing jumps out... I thought maybe there's a stray akka reference in the pekko branch, but a grep reveals nothing but some copied comments that haven't been suitably adapted...
from kamon.
Well the only thing that changed that I could think of as relevant is the sbt version. It's possible that some semantic correction has led to a 'provided' dependency actually.. being... provided. Suggest checking the dependencies of the modules you use, and explicitly including what ever logback libs you were implicitly depending on before...
from kamon.
A microproject that emulated this problem would be immensely helpful anyway. Since there are multiple thumbs up on this, I assume that someone should be able to whip one up. I'll dig in as soon as I can.
from kamon.
@hughsimpson, thanks for looking into this. Here is my issue:
build.properties
sbt.version = 1.6.2
build.sbt
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "2.13.12"
val LogbackVersion = "1.4.11"
val KamonVersion = "2.6.4"
val ScalaLoggingVersion = "3.9.5"
lazy val root = (project in file("."))
.settings(
name := "untitled",
libraryDependencies ++= Seq(
"com.typesafe.scala-logging" %% "scala-logging" % ScalaLoggingVersion,
"ch.qos.logback" % "logback-classic" % LogbackVersion,
"io.kamon" %% "kamon-bundle" % KamonVersion,
"io.kamon" %% "kamon-prometheus" % KamonVersion
)
)
src/main/resources/logback.xml
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level%X{runId}%X{requestId} %-36.36logger{36} %msg%n%rEx</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
src/main/scala/Main.scala
import com.typesafe.scalalogging.LazyLogging
import org.slf4j.MDC
import java.util.UUID
object Main extends App with LazyLogging {
MDC.put("runId", s" [runId=${UUID.randomUUID().toString}]")
MDC.put("requestId", s" [requestId=${UUID.randomUUID().toString}]")
logger.info("Sample message")
MDC.clear()
}
Kamon 2.6.3
Here is the output
2023-10-08 23:02:19.661 INFO [runId=2c7cc229-afb2-4d8e-9a18-c34eda1af7e9] [requestId=7434964a-e58d-40ce-aae8-d46bb2b13335] Main$ Sample message
Process finished with exit code 0
Kamon 2.6.4
Here is the output
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Process finished with exit code 0
I also checked the classpath, and everything is the same. I think your suspicion about some classes creeping into the Kamon is the cause.
Let me know if you want me to upload the project somewhere, but it's basically just these files.
from kamon.
Related Issues (20)
- Maven metadata does not contain info about Kamon Bundle v2.6.5 HOT 1
- Kamon doesn't propage Kamon context HOT 7
- Sbt 1.9.7 upgrade breaks Kamon Play HTTP Prometheus Metrics HOT 2
- Upgrade newrelic.telemetry to 0.16.0 HOT 2
- Add support for Micrometer
- Instrumentation is broken With play 3.0, scala 3.3.1, kamon-bundle and Prometheus HOT 1
- Support for postgresql 42.7.2 - java.lang.NoSuchFieldError: checkConnectionQuery HOT 6
- Issue while using jaeger reporter with scala HOT 1
- Akka-http metrics do not work when using http2
- ClassCastException when using Slick and Kamon Jdbc
- Trying to load Akka instrumentation when using Pekko in Scala 3 HOT 2
- Updating Postgres Driver causes NoSuchFieldError from Kamon JDBC HOT 2
- How to use local-tail-sampler
- DataDog Reporter to send EntityId from environment
- Updating kafka-clients to 3.7.0 breaks kafka instrumentation
- Latest 2.7.2 leads to NoClassDefFoundError HOT 5
- Datadog API Reporter fails to authenticate
- Tracing and context propagation are not supported in Scala 3
- Nullpointer exception for pekko-instrumentation in version 1.1.0-M1 onward HOT 27
- Context propagation is broken for Promises HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kamon.