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-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala | |
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-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala')
-rw-r--r-- | kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala b/kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala index 94bab27c..8fbf4fee 100644 --- a/kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala +++ b/kamon-statsd/src/main/scala/kamon/statsd/StatsDMetricsSender.scala @@ -26,10 +26,10 @@ import java.util.Locale import kamon.metric.instrument.{ Counter, Histogram } -class StatsDMetricsSender(remote: InetSocketAddress, maxPacketSizeInBytes: Long) extends Actor with UdpExtensionProvider { +class StatsDMetricsSender(remote: InetSocketAddress, maxPacketSizeInBytes: Long, metricKeyGenerator: StatsD.MetricKeyGenerator) + extends Actor with UdpExtensionProvider { import context.system - val metricKeyGenerator = new SimpleMetricKeyGenerator(context.system.settings.config) val symbols = DecimalFormatSymbols.getInstance(Locale.US) symbols.setDecimalSeparator('.') // Just in case there is some weird locale config we are not aware of. @@ -80,7 +80,8 @@ class StatsDMetricsSender(remote: InetSocketAddress, maxPacketSizeInBytes: Long) } object StatsDMetricsSender { - def props(remote: InetSocketAddress, maxPacketSize: Long): Props = Props(new StatsDMetricsSender(remote, maxPacketSize)) + def props(remote: InetSocketAddress, maxPacketSize: Long, metricKeyGenerator: StatsD.MetricKeyGenerator): Props = + Props(new StatsDMetricsSender(remote, maxPacketSize, metricKeyGenerator)) } trait UdpExtensionProvider { |