No HTTP request metrics with akka-http and kamon 1.0

176 views
Skip to first unread message

peter...@gmail.com

unread,
Aug 22, 2018, 5:28:55 AM8/22/18
to kamon-user
I've been struggling for a few days to migrate from kamon 0.6.x to 1.0.x.
Currently I'm stuck with trying to get the same request metrics sent to statsd as we had before.

Using kamon 0.6 and akka-http we could get metrics for the response code our apps responded with
E.g metrics take from statsd using kamon 0.6

'skeleton.QSWEM051_local.none.http-server.akka-http-server.200': 0,
'skeleton.QSWEM051_local.none.http-server.akka-http-server.404': 0,

No I just can't those metrics reported after upgrading to newer versions of akka/akka-http and kamon 1.0.x

What I get is
QSWEM051:~ pnerg$ echo counters | nc 127.0.0.1 8126
{ 'statsd.bad_lines_seen': 0,
'statsd.packets_received': 4,
'statsd.metrics_received': 26,
'change-me.QSWEM051_local.none.akka_system_processed-messages.system.skeleton.tracked.true': 0,
'change-me.QSWEM051_local.none.akka_system_processed-messages.system.InitialServiceConfigurator.tracked.true': 0,
'change-me.QSWEM051_local.none.akka_system_processed-messages.system.InitialServiceConfigurator.tracked.false': 0,
'change-me.QSWEM051_local.none.akka_system_processed-messages.system.skeleton.tracked.false': 5,
'change-me.QSWEM051_local.none.akka_system_unhandled-messages.system.InitialServiceConfigurator': 0,
'change-me.QSWEM051_local.none.akka_system_unhandled-messages.system.skeleton': 0,
'change-me.QSWEM051_local.none.akka_system_dead-letters.system.InitialServiceConfigurator': 0,
'change-me.QSWEM051_local.none.akka_system_dead-letters.system.skeleton': 0,
'change-me.QSWEM051_local.none.tracer_spans-created': 0 }
END


I've experimented with just about every type of filter and settting I've found on the net.
Unfortunately the documentation around instrumenting akka-http is rather scarce and what configuration possibilities there are

My config looks like this

kamon {

util.filters {
akka-actor.includes = ["**"]
akka-router.includes = ["**"]
akka-dispatcher.includes = ["**"]
trace.includes = ["**"]
trace-segment.includes = ["**"]
histogram.includes = ["**"]
min-max-counter.includes = ["**"]
gauge.includes = ["**"]
counters.includes = ["**"]
http-server.includes = ["**"]
akka-http-server.includes = ["**"]
}

metric {
tick-interval = 1 seconds
}


modules {
kamon-statsd.auto-start = true
kamon-system-metrics.auto-start = true
kamon-log-reporter.auto-start = true
kamon-akka-http.requires-aspectj = true
kamon-akka.requires-aspectj = true
}

statsd {
hostname = "127.0.0.1"
flush-interval = 1 second
port = 8125
subscriptions {
histogram = [ "**" ]
min-max-counter = []
gauge = []
counter = [ "**" ]
trace = [ "**" ]
trace-segment = [ "**" ]
akka-actor = []
akka-dispatcher = []
akka-router = []
system-metric = []
http-server = [ "**" ]
}
}
}

I'm starting the app from sbt using sbt run and I have the aspectj plugin
addSbtPlugin("io.kamon" % "sbt-aspectj-runner" % "1.1.0")

My dependencies are
"com.typesafe.akka" %% "akka-actor" % "2.5.13"
"com.typesafe.akka" %% "akka-http-core" % "10.1.3"
"com.typesafe.akka" %% "akka-http" % `akka-http-core`.revision
"com.typesafe.akka" %% "akka-http-spray-json" % `akka-http-core`.revision
"io.kamon" %% "kamon-core" % "1.0.0"
"io.kamon" %% "kamon-akka-http-2.5" % `kamon-core`.revision
"io.kamon" %% "kamon-statsd" % `kamon-core`.revision
"io.kamon" %% "kamon-system-metrics" % `kamon-core`.revision
"io.kamon" %% "kamon-akka-2.5" % "1.1.2"

Hope anyone can shed some light on this topic...I find myself stumbling around in the dark at the moment

dam...@mazur.io

unread,
Oct 26, 2018, 3:46:01 PM10/26/18
to kamon-user

Hi Peter, any luck? Currently struggling with the same issue.

Ivan Topolnjak

unread,
Oct 26, 2018, 3:48:38 PM10/26/18
to kamon...@googlegroups.com
Hey folks! Come over to the Gitter channel: https://gitter.im/kamon-io/Kamon

This list will probably be closed soon :/... see you on Gitter!

--
You received this message because you are subscribed to the Google Groups "kamon-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kamon-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Nerg

unread,
Oct 30, 2018, 8:32:20 AM10/30/18
to kamon...@googlegroups.com
I stared into the source code (https://github.com/kamon-io/kamon-akka-http/blob/master/kamon-akka-http/src/main/scala/kamon/akka/http/AkkaHttpMetrics.scala) and realised the stats I was after is not produced.
So I resorted to create my own custom reporter receiving information on all closed spans and from there generate metrics for the response code in each completed span. Rather straight forward and fairly well documented.


On Fri, Oct 26, 2018 at 9:46 PM <dam...@mazur.io> wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "kamon-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kamon-user/yzsVvi5TKJ0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kamon-user+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--

Sent from my Android hence the brevity

Reply all
Reply to author
Forward
0 new messages