diff options
author | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-13 17:56:51 -0300 |
---|---|---|
committer | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-13 17:56:51 -0300 |
commit | 111ea55690351d0903e9902c525c781ef2d743a8 (patch) | |
tree | 003b0e1cf95f1d3cba55927422ff063c049a5cf9 /kamon-newrelic/src/main/scala | |
parent | 571e96665bb3cb3f20fb59209be63dabbb3148f4 (diff) | |
parent | 7a10c0ef2a6566229e8571f6d385ca2ff794cc20 (diff) | |
download | Kamon-111ea55690351d0903e9902c525c781ef2d743a8.tar.gz Kamon-111ea55690351d0903e9902c525c781ef2d743a8.tar.bz2 Kamon-111ea55690351d0903e9902c525c781ef2d743a8.zip |
Merge branch 'wip/trace-and-metrics-integration'
Conflicts:
kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala
Diffstat (limited to 'kamon-newrelic/src/main/scala')
-rw-r--r-- | kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala | 4 | ||||
-rw-r--r-- | kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicReporting.scala | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala index f933bee4..668e29f7 100644 --- a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala +++ b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala @@ -27,13 +27,13 @@ class NewRelic extends ExtensionId[NewRelicExtension] { } class NewRelicExtension(system: ExtendedActorSystem) extends Kamon.Extension { - val manager: ActorRef = system.actorOf(Props[NewRelicManager], "kamon-newrelic") + val api: ActorRef = system.actorOf(Props[NewRelicManager], "kamon-newrelic") } class NewRelicManager extends Actor with ActorLogging { log.info("Registering the Kamon(NewRelic) extension") - Kamon(Trace)(context.system) ! Trace.Register + Kamon(Trace)(context.system).api ! Trace.Register val webTransactionMetrics = context.actorOf(Props[WebTransactionMetrics], "web-transaction-metrics") val agent = context.actorOf(Props[Agent], "agent") diff --git a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicReporting.scala b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicReporting.scala index 000e6286..4e3d0d8d 100644 --- a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicReporting.scala +++ b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicReporting.scala @@ -17,7 +17,7 @@ package kamon.newrelic import akka.actor.Actor import kamon.trace.UowTrace -import com.newrelic.api.agent.NewRelic +import com.newrelic.api.agent.{ NewRelic ⇒ NR } import kamon.trace.UowTracing.WebExternal class NewRelicReporting extends Actor { @@ -28,16 +28,16 @@ class NewRelicReporting extends Actor { def recordTransaction(uowTrace: UowTrace): Unit = { val time = ((uowTrace.segments.last.timestamp - uowTrace.segments.head.timestamp) / 1E9) - NewRelic.recordMetric("WebTransaction/Custom" + uowTrace.name, time.toFloat) - NewRelic.recordMetric("WebTransaction", time.toFloat) - NewRelic.recordMetric("HttpDispatcher", time.toFloat) + NR.recordMetric("WebTransaction/Custom" + uowTrace.name, time.toFloat) + NR.recordMetric("WebTransaction", time.toFloat) + NR.recordMetric("HttpDispatcher", time.toFloat) uowTrace.segments.collect { case we: WebExternal ⇒ we }.foreach { webExternalTrace ⇒ val external = ((webExternalTrace.finish - webExternalTrace.start) / 1E9).toFloat - NewRelic.recordMetric(s"External/${webExternalTrace.host}/http", external) - NewRelic.recordMetric(s"External/${webExternalTrace.host}/all", external) - NewRelic.recordMetric(s"External/${webExternalTrace.host}/http/WebTransaction/Custom" + uowTrace.name, external) + NR.recordMetric(s"External/${webExternalTrace.host}/http", external) + NR.recordMetric(s"External/${webExternalTrace.host}/all", external) + NR.recordMetric(s"External/${webExternalTrace.host}/http/WebTransaction/Custom" + uowTrace.name, external) } val allExternals = uowTrace.segments.collect { case we: WebExternal ⇒ we } sortBy (_.timestamp) @@ -53,8 +53,8 @@ class NewRelicReporting extends Actor { val external = measureExternal(0, 0, allExternals) / 1E9 - NewRelic.recordMetric(s"External/all", external.toFloat) - NewRelic.recordMetric(s"External/allWeb", external.toFloat) + NR.recordMetric(s"External/all", external.toFloat) + NR.recordMetric(s"External/allWeb", external.toFloat) } } |