diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-08-04 23:38:41 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-08-04 23:38:41 -0300 |
commit | 699917cfdb6978d5682cb4427635f29d01fa79d7 (patch) | |
tree | 1adcd36db5c3095be286e6220ac8a18a67ae381c /kamon-newrelic/src/main/scala | |
parent | 74ede511fb43bfda3ced86b3f15fd2ac61abd13a (diff) | |
download | Kamon-699917cfdb6978d5682cb4427635f29d01fa79d7.tar.gz Kamon-699917cfdb6978d5682cb4427635f29d01fa79d7.tar.bz2 Kamon-699917cfdb6978d5682cb4427635f29d01fa79d7.zip |
= newrelic: upgrade to the latest user metrics
Diffstat (limited to 'kamon-newrelic/src/main/scala')
-rw-r--r-- | kamon-newrelic/src/main/scala/kamon/newrelic/CustomMetrics.scala | 5 | ||||
-rw-r--r-- | kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/kamon-newrelic/src/main/scala/kamon/newrelic/CustomMetrics.scala b/kamon-newrelic/src/main/scala/kamon/newrelic/CustomMetrics.scala index 44d9c605..a2b208dc 100644 --- a/kamon-newrelic/src/main/scala/kamon/newrelic/CustomMetrics.scala +++ b/kamon-newrelic/src/main/scala/kamon/newrelic/CustomMetrics.scala @@ -17,6 +17,7 @@ package kamon.newrelic import akka.actor.Actor +import kamon.metric.UserMetrics.UserMetricGroup import kamon.metric._ trait CustomMetrics { @@ -24,9 +25,9 @@ trait CustomMetrics { def collectCustomMetrics(metrics: Map[MetricGroupIdentity, MetricGroupSnapshot]): Seq[NewRelic.Metric] = { metrics.collect { - case (UserMetrics, groupSnapshot) ⇒ + case (mg: UserMetricGroup, groupSnapshot) ⇒ groupSnapshot.metrics collect { - case (name, snapshot) ⇒ toNewRelicMetric(Scale.Unit)(s"Custom/$name", None, snapshot) + case (name, snapshot) ⇒ toNewRelicMetric(Scale.Unit)(s"Custom/${mg.name}", None, snapshot) } }.flatten.toSeq } diff --git a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala index d83e0335..fd97b2c0 100644 --- a/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala +++ b/kamon-newrelic/src/main/scala/kamon/newrelic/NewRelic.scala @@ -16,6 +16,7 @@ package kamon.newrelic import akka.actor._ +import kamon.metric.UserMetrics.{ UserGauges, UserMinMaxCounters, UserCounters, UserHistograms } import scala.concurrent.duration._ import kamon.Kamon import kamon.metric.{ UserMetrics, TickMetricSnapshotBuffer, TraceMetrics, Metrics } @@ -31,7 +32,13 @@ class NewRelicExtension(system: ExtendedActorSystem) extends Kamon.Extension { val apdexT: Double = config.getDuration("apdexT", MILLISECONDS) / 1E3 // scale to seconds. Kamon(Metrics)(system).subscribe(TraceMetrics, "*", metricsListener, permanently = true) - Kamon(Metrics)(system).subscribe(UserMetrics.category, "*", metricsListener, permanently = true) + + // Subscribe to all user metrics + Kamon(Metrics)(system).subscribe(UserHistograms, "*", metricsListener, permanently = true) + Kamon(Metrics)(system).subscribe(UserCounters, "*", metricsListener, permanently = true) + Kamon(Metrics)(system).subscribe(UserMinMaxCounters, "*", metricsListener, permanently = true) + Kamon(Metrics)(system).subscribe(UserGauges, "*", metricsListener, permanently = true) + } class NewRelicMetricsListener extends Actor with ActorLogging { |