Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Anubhav Sharma
@anubhav21sharma_gitlab
I have one more question. Is there a way to log details of all spans on the stdout as well apart from sending them to the jaeger/zipkin collector?
Ivan Topolnjak
@ivantopo
nope
but if you wanted to create a reporter that just printlns everything it would be very simple
Dinesh Narayanan
@ndchandar

Hey @ndchandar, thats exactly what kamon-akka-http module is doing, did you try it out?

@mladens Today Kamon Akka Http only provides operationName(in TracingDirectives). What i need is to create new entry for every new route request. I create sample gist to describe the scenario a bit https://gist.github.com/ndchandar/15a81f904fbf21b2149346c6d120fab7

As you can see there, the code is not very dry due to Kamon.runWithContextEntry(CorrelationIdCodec.correlationKey, IdGenerator.newId) in multiple places.

I wanted to check a) if there is a better way to do this b) if i happen to need that context entry in my own internal custom directive (as in the second route someCrudApi2) how to do it in more succinct way without duplicating

Dinesh Narayanan
@ndchandar
Hello,
I need some help on this one. I have correlationId as context entry. But for some reason it doesn't get propagated in our log files (they are coming as null). I have attached sample gist https://gist.github.com/ndchandar/cdcbbbd73a786f487d066417dd5a1913.
I can confirm that i can see the correlationId set correctly in the context
What do you think i am missing ?
Ivan Topolnjak
@ivantopo
hey @ndchandar, may I ask whether you have an explicit need to use a dedicated entry for the correlationId.. if not, I would suggest just using the traceID as the correlation ID
Dinesh Narayanan
@ndchandar
The standard we have in our group is that if we have correlationIdalready set in incoming header, we need to use that as our loggingIdwhen logging. Many micro-services call our services
Dinesh Narayanan
@ndchandar
Update: If I keep correlationId in context tags (instead of context entry) logback logs ok.
Ivan Topolnjak
@ivantopo
hey @ndchandar, I was looking into your gist and first, clever trick! mixing the entry readers and a context tag :D! I would just make one suggestion there: stick to only one way of transporting the correlation ID, so that it is either a Context Tag OR a Context Entry. If you need to pass it around several microservices that already have code for that I would suggest that you use the Context tags since they will transparently propagate through all Kamon-enabled services.. if you went to use a Context entry then you would need to share the entry reader/writer implementation across all of them and that can become cumbersome
then you had just one issue left: generating the correlationId when its not present.. here, if you are using Akka HTTP I would suggest just creating one directive on the top level and wrapping the entire routing tree with it
if you want to stick to the entry reader/writer hack, just change this line: https://gist.github.com/ndchandar/cdcbbbd73a786f487d066417dd5a1913#file-corrrelationidcodec-scala-L20 so that instead of adding a Context entry it will read whether the correlationId tag is present and if not, generate a new one
(I checked the source behing HTTP propagation and the Context passed into that function will have all tags that have been read so far! and, there is no hard constrain that an entry reader must add anything to the context or that when it adds it has to be an entry, you can just use it to write the Context tag if necessary)
Srepfler Srdan
@schrepfler
hi guys, the kamon zipkin module hasn't been published for 2.0.1
io.kamon#kamon-zipkin_2.13;2.0.1: not found
Ivan Topolnjak
@ivantopo
hey @schrepfler, there was no need to upgrade the module, it will work just fine!
we are only alining around the major version number
Diego Parra
@dpsoft
Hi everyone, we just published a new version of kamon-http4s equipped with kamon 2.0 https://bintray.com/kamon-io/releases/kamon-http4s
Dinesh Narayanan
@ndchandar
Thank you @ivantopo
Vasily Kirichenko
@vasily-kirichenko
hey guys. Is it possible to tell kamon to send data more often than 1 / minute?
Ivan Topolnjak
@ivantopo
hey there
yeap, look at the kamon.metric.tick-interval setting
Vasily Kirichenko
@vasily-kirichenko
@ivantopo it works! :) thank you.
Ivan Topolnjak
@ivantopo
:+1:
Sebastien Vermeille
@sebastienvermeille
Hi guys, I migrated to kamon 2.13 (java 13) and now it looks like gauge.set(value) no longer exists ? how should I migrate this please ?
Ivan Topolnjak
@ivantopo
hey @sebastienvermeille, that method is now called "update"
Sebastien Vermeille
@sebastienvermeille
@ivantopo thank you for your response but It looks like it do not exists
give me a few sec to check again
Ivan Topolnjak
@ivantopo
maybe you were using a Gauge without any tags
Sebastien Vermeille
@sebastienvermeille
GaugeMetric
Ivan Topolnjak
@ivantopo
in 1.x you could just do that, but from 2.x you need to call .withoutTags
so that you go from the GaugeMetric to an actual Gauge instrument
Sebastien Vermeille
@sebastienvermeille
I yes I did this:
Kamon.gauge("myname")
probably outdated way of doing
Ivan Topolnjak
@ivantopo
yeap
the equivalent of that is Kamon.gauge("myname").withoutTags()
there was an "implicit" withoutTags on the gauge metrics
Sebastien Vermeille
@sebastienvermeille
ah okay and then I return a Gauge directly?
Ivan Topolnjak
@ivantopo
I think so! the type returned from withoutTags is a Gauge
Sebastien Vermeille
@sebastienvermeille
final Inst item = Kamon.gauge(name).withoutTags();
I should work on the Inst object or on the gauge to update the value ? (sorry I am completely lost :/ )
because Metric.Gauge object .withoutTags().update(value) do not exists
  void setSystemCpuCoresAmount(final int amountOfLogicalCore) {
    getKamonGauge(SYSTEM_CPU_CORE_AMOUNTS_GAUGE).update(amountOfLogicalCore);
  }

  Gauge getKamonGauge(final String gaugeName) {
    return (Gauge) Kamon.gauge(gaugeName);
  }
ok solved it that way
Sebastien Vermeille
@sebastienvermeille
thank you very much @ivantopo
Sebastien Vermeille
@sebastienvermeille
erf ok wrong, this worked because of kamon system metrics was still in 2.12 :D
solved anyway :) now its a matter of using kamon-system-metrics 2.12 with kamon 2.13 :/
Ivan Topolnjak
@ivantopo
actually, we did publish the system metrics module for Scala 2.13
Sebastien Vermeille
@sebastienvermeille
@ivantopo yes its available but I was not sure as the readme looks not really saying it and SystemMetrics is not found
maybe its a good time for me to write a few mini PR for the doc :)
Ivan Topolnjak
@ivantopo
that would be awesome!