Commit graph

11 commits

Author SHA1 Message Date
Matthias Rampke
40a13e604f
Move mapper -> pkg/mapper
to make clear that this is meant to be used elsewhere

Signed-off-by: Matthias Rampke <mr@soundcloud.com>
2018-08-14 09:20:00 +00:00
Matthias Rampke
124c5b88d0
Move mapper to a package
This allows the mapping logic and configuration format to be re-used by
the graphite exporter.

Enables prometheus/graphite_exporter#37, cf. https://github.com/prometheus/graphite_exporter/pull/52#issuecomment-412324849

Signed-off-by: Matthias Rampke <mr@soundcloud.com>
2018-08-12 11:14:18 +00:00
Matthias Rampke
0ac908603a Update documentation of metric name escaping.
The escaping changed in 728bdc52ae, before
0.1.0. Add a test for the escape function, and test various cases,
including those mentioned in the README.

This reveals that the README is inaccurate, adjust it to what has been
the reality for many years. Fixes #97.
2017-11-10 20:34:10 +00:00
Matthias Rampke
ea77554dc4 Force IPv4 for the mock TCP listener.
Travis CI [does not have IPv6][0] in any environment. It could be
[enabled][1] if we ran the build in a VM, but that is much slower to
start. Instead, we just force the test connection to use IPv4.

[0]: https://blog.travis-ci.com/2015-11-27-moving-to-a-more-elastic-future#ipv6-no-longer-present
[1]: https://github.com/travis-ci/travis-ci/issues/5200#issuecomment-162539556
2017-11-10 14:21:38 +00:00
Dave Rawks
0478c40ab0 Removes -statsd.add-suffix option flag
* Remove option flag
* Update NewExporter call signature to not take suffix boolean
* Update tests to reflect new behavior and signature
* Update documentation to reflect option flag removal
2017-09-28 11:30:17 -07:00
Dave Rawks
06444ed5c0 Minor fix-ups per PR discussion
* Removed extraneous newline
  * Reformatted/ordered imports
  * Used hash function to derive index of `Elements` instead of
    hardcoding hash result
2017-08-15 08:51:13 -07:00
Dave Rawks
b2082eda2b Added test for histogram unit conversion 2017-08-14 15:20:45 -07:00
jwfang
07543ac557 Add TCP StatsD listener support (#71)
* add TCP StatsD listener support

* add listen-tcp flag to control UDP/TCP mode on same port

* statsdListenUDP/statsdListenTCP as string, and alias listen-address to listen-udp

* add stats for tcp error/line_too_long

* add test for TCP listener
2017-08-01 12:21:00 +02:00
Ilya Margolin
bb4e42068f Skip metrics with invalid utf8 2016-07-20 20:27:23 +02:00
Johannes 'fish' Ziemke
4d22a721eb Fix parameter to NewExporter in test 2016-05-03 23:45:48 +02:00
Jonathon Klobucar
494cc38bf8 Don't panic when negative number counter is submitted.
Instead now we will send a warning message to the logs
and continue on with our day.

Also a guard has been added when we detect a channel has been
closed and the `Exporter.Listen` function will return out of
its loop vs always running. When a channel is closed there will
be no more data to consume, so this seems correct. It also allows
for a test to be written for the panic.
2016-04-01 10:53:20 -07:00