Comments (8)
I will add that on previous kamon version (2.5.12) i didn't saw this double logging.
from kamon.
Before we were logging that banner from Kanela (the javaagent) but since 2.6.0 we moved it to Kamon Kamon itself, so my guess is that your code is calling Kamon.init twice, the question is how if you are only calling init in the application loader 🤔
Is this happening when running in K8s or SBT, or both?
from kamon.
Im running only on kubernetes (kubeadm deploy or minikube). On sbt run my project would not run (because of service discovery configuration). Im sure im only running it once in application loader of lagom. Maybe Lagom is calling twice for service creation? Now i don't have time to do research on this but next time i will check what i can find about it.
If kamon is called twice with init it will create second monitoring or it is like singleton and second call will be ignored?
from kamon.
Hello,
i created simple lagom application with deployment to minikube (it is based on sbt new lagom/lagom-scala.g8
).
I added kanela and kamon dependency and added logger before initializing kamon and i found something.
First attempt looks like this:
override def load( context: LagomApplicationContext ): LagomApplication = {
logger.info( "Initializing Kamon" )
Kamon.initWithoutAttaching( context.playContext.initialConfiguration.underlying )
context.playContext.lifecycle.addStopHook( ( ) => {
Kamon.stop()
} )
new HelloWorldApplication( context ) {
override def serviceLocator: ServiceLocator = NoServiceLocator
}
}
After running in minikube i saw that kamon is double printed in pod console.
Then i tried to change initialization without parameters.
After change i used just this:
Kamon.initWithoutAttaching()
And after deployment only one Kamon log appeared in console.
It seems like passing context.playContext.initialConfiguration.underlying
to initialization is creating second kamon instance or is forcing second printing of Kamon logo.
from kamon.
I propably found why Kamon is double printed.
When using initWithoutAttaching with configuration then this function is called in Kamon project (Init.scala):
def initWithoutAttaching(config: Config): Unit = {
self.reconfigure(config)
if(enabled()) {
self.initWithoutAttaching()
} else {
self.disableInstrumentation()
}
self.logInitStatusInfo()
}
On the end of function logging is done.
If kamon is enabled then self.initWithoutAttaching()
is called and this is executed:
def initWithoutAttaching(): Unit = {
if(enabled()) {
self.initScheduler()
self.loadModules()
self.moduleRegistry().init()
} else {
self.disableInstrumentation()
}
self.logInitStatusInfo()
}
And again in this function logging is called on the end.
So for me it seems like when passing config logging is called twice.
from kamon.
Yeah, that's exactly it. Fixed it on #1256
from kamon.
All in all, it's just the banner printed twice, but Kamon is not initialized twice.
from kamon.
For me this is a very small issue and can be ignored.
Im closing this issue.
from kamon.
Related Issues (20)
- Kafka instrumentation. Add supporting for different context type propagation HOT 1
- Kamon-Cassandra Datastax OSS Metrics Factory
- kamon.io, kanela agent unable to post metrics to https enabled graphite backend
- Java 8 support, new relic http client HOT 2
- Context propagation is broken from Akka 2.8.0 onwards HOT 3
- Bumping 2.6.3 to 2.6.4 (kamon-bundle and kamon-prometheus) breaks logging in our apps (Akka HTTP, Play) HOT 9
- Old kanela-agent which does not support JDK 21 HOT 5
- 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
- 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 1
- Updating Postgres Driver causes NoSuchFieldError from Kamon JDBC HOT 2
- How to use local-tail-sampler
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.