val XKey = Key.broadcastString("x-key")
val context =
Kamon.currentContext().get(XKey) match {
case None =>
Kamon.currentContext().withKey(XKey, Some("XKey Value"))
case _ => Kamon.currentContext()
}
Kamon.withContext(context) {
for {
result <- httpClient(Get(uri))
} yield result
}
Kamon.init()
as the very first operation in your code. I am deploying my service as a war, and I'm getting an java.lang.reflect.InvocationTargetException
when I call it in the Context Listener. Where should I be calling it?Hi! Is there a way to specify custom bucket limits? for example i used seconds Kamon.histogram("tsr-last-trained-point", MeasurementUnit.time.seconds)
and i get buckets like this
tsr_last_trained_point_seconds_bucket{le="0.005",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="0.01",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="0.025",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="0.05",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="0.075",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="0.1",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="0.25",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="0.5",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="0.75",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="1.0",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="2.5",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="5.0",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="7.5",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="10.0",granularity="HOUR"} 0.0
tsr_last_trained_point_seconds_bucket{le="+Inf",granularity="HOUR"} 50.0
tsr_last_trained_point_seconds_count{granularity="HOUR"} 50.0
tsr_last_trained_point_seconds_sum{granularity="HOUR"} 102740.0
But i want buckets like 3600 (hour), 86100(day), week and etc... How can i define histogram like this?
I already got kamon working using the full ?kamon-bundle
but I can see that it adds a lot of dependencies which I dont need/want.
Whats the best way to pick only the things I need put still get the same auto instrumentation as if I would use the full bundle?
Lets say I only want to use: kamon-executors
, kamon-scala-future
, kamon-cassandra
.
I think I could just exclude all other modules via libraryExclusions
but imo the other way around, including only what I want, would be better.
build.sbt
and saw that the kamon-bundle
dependsOn
a lot of modules and I mistakenly assumed that all those modules would be automatically pulled in if I add kamon-bundle
as a dependency to my project.kamon-bundle
and kamon-core
beeing pulled in if I just specify kamon-bundle
as a dependecy. So it looks fine.Counter
, Gauge
etc more advanced or is it just a matter of additional abstraction over the actual metrics implementation which is beneficial?