diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-07-10 20:53:39 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-07-10 20:53:39 -0300 |
commit | 9d81b6cf128859030f393c07a7d08abc464acbcf (patch) | |
tree | e896733d882501541ff83bd76b23d8e83b1e24fc /kamon-datadog/src/main/scala/kamon/datadog | |
parent | 3686990509d004b53f5c069a5353d0484556eb2e (diff) | |
download | Kamon-9d81b6cf128859030f393c07a7d08abc464acbcf.tar.gz Kamon-9d81b6cf128859030f393c07a7d08abc464acbcf.tar.bz2 Kamon-9d81b6cf128859030f393c07a7d08abc464acbcf.zip |
! statsd,datadog: reformat metric names to get a better display of automatically named traces, closes #35
After a bit of testing it seems like instead of generating more friendly names by default, we need to do
changes that are specific to each module (StatsD and Datadog) in order to make it work properly. Here is
a list of the introduced changes:
- StatsD
- Change dots (.) to underscores (_) on the host name string.
- Change ': ' to single underscore and spaced to underscore. Userful for automatically generated http
trace names.
- Change '/' to underscore. Ideally the dashboard could replace '_' with '/' to display it like a path.
- Datadog
- Change ': ' to ':'. Userful for automatically generated http trace names.
Diffstat (limited to 'kamon-datadog/src/main/scala/kamon/datadog')
-rw-r--r-- | kamon-datadog/src/main/scala/kamon/datadog/Datadog.scala | 6 | ||||
-rw-r--r-- | kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/kamon-datadog/src/main/scala/kamon/datadog/Datadog.scala b/kamon-datadog/src/main/scala/kamon/datadog/Datadog.scala index b4358ce7..1ae493f7 100644 --- a/kamon-datadog/src/main/scala/kamon/datadog/Datadog.scala +++ b/kamon-datadog/src/main/scala/kamon/datadog/Datadog.scala @@ -70,12 +70,12 @@ class DatadogExtension(system: ExtendedActorSystem) extends Kamon.Extension { def buildMetricsListener(tickInterval: Long, flushInterval: Long): ActorRef = { assert(flushInterval >= tickInterval, "Datadog flush-interval needs to be equal or greater to the tick-interval") - val metricsTranslator = system.actorOf(DatadogMetricsSender.props(datadogHost, maxPacketSizeInBytes), "datadog-metrics-sender") + val metricsSender = system.actorOf(DatadogMetricsSender.props(datadogHost, maxPacketSizeInBytes), "datadog-metrics-sender") if (flushInterval == tickInterval) { // No need to buffer the metrics, let's go straight to the metrics sender. - metricsTranslator + metricsSender } else { - system.actorOf(TickMetricSnapshotBuffer.props(flushInterval.toInt.millis, metricsTranslator), "datadog-metrics-buffer") + system.actorOf(TickMetricSnapshotBuffer.props(flushInterval.toInt.millis, metricsSender), "datadog-metrics-buffer") } } } diff --git a/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala b/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala index 17e19d0b..0f67cc34 100644 --- a/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala +++ b/kamon-datadog/src/main/scala/kamon/datadog/DatadogMetricsSender.scala @@ -90,8 +90,11 @@ class DatadogMetricsSender(remote: InetSocketAddress, maxPacketSizeInBytes: Long def buildMetricName(groupIdentity: MetricGroupIdentity, metricIdentity: MetricIdentity): String = s"$appName.${groupIdentity.category.name}.${metricIdentity.name}" - def buildIdentificationTag(groupIdentity: MetricGroupIdentity, metricIdentity: MetricIdentity): String = - s"|#${groupIdentity.category.name}:${groupIdentity.name}" + def buildIdentificationTag(groupIdentity: MetricGroupIdentity, metricIdentity: MetricIdentity): String = { + // Make the automatic HTTP trace names a bit more friendly + val normalizedEntityName = groupIdentity.name.replace(": ", ":") + s"|#${groupIdentity.category.name}:${normalizedEntityName}" + } } object DatadogMetricsSender { |