Commit graph

21 commits

Author SHA1 Message Date
Brian Akins 6738c909a5 Add drop action for matches 2018-01-02 17:21:50 -05:00
Brian Akins e58bf8e1ca Set name in mapping, rather than from special label with key 'name' 2017-11-13 07:23:14 -05:00
Matthias Rampke 6c04ec1d89 Fix mapping example in the README
Strings with leading asterisks need to be escaped in YAML.

Add the same examples into the test suite to make sure they do what we
claim they do.

Fixes #102.
2017-11-10 20:19:41 +00:00
Matthias Rampke 45d22f2add Add examples for quoting matches that start with *.
The YAML parser chokes on strings starting with asterisks. Add a
scenario to the spec that shows this, and that shows that quoting fixes
the issue.
2017-11-10 20:01:57 +00:00
Matthias Rampke e24888356f Add example for configuration without trailing newline.
Inspired by #102, illustrate and ensure that trailing newlines are not
necessary.
2017-11-10 20:01:15 +00:00
Jens Bissinger 78de4b11db Fix matching empty statsd metric components 2017-11-10 15:29:24 +00:00
Ben Kochie 9accf494a9 Merge pull request #98 from drawks/remove_legacy_mapper
Removes support for legacy mapper config
2017-09-29 10:08:08 +02:00
Dave Rawks ec3cc120e2 Resolves #84 adds support for regex mappers (#85)
* Added `regex` match_type as valid config callout in both individual mappers
    and mapper defaults
  * Added test coverage for changes
  * Updated documentation to reflect usage of `match_type` parameter and
    provide example of a raw regex match rule
2017-09-29 09:57:17 +02:00
Dave Rawks 892b725faf Removes support for legacy mapper config
* Removed legacy mapper config parser
  * Removed logic to switch to YAML parsing based on mapping filename
  * Removed tests for legacy mapper config
  * Remove references to legacy mapper config format from `README.md`
2017-09-28 11:11:26 -07:00
Brian Akins 93243f61a1 add test case for timer types 2017-07-27 17:01:12 -04:00
Brian Akins c9510f7f23 add simple YAML config tests 2017-07-27 16:58:10 -04:00
Brian Akins 74975b8411 merge with upstream master 2017-07-26 14:03:08 -04:00
Jason Mooberry 5018c7415a Allow comments in mapping files 2017-05-23 18:12:17 -04:00
Brian Akins 641dc37b5d getMapping now returns 3 values 2017-03-13 08:15:43 -04:00
Ville Törhönen 446b7e6d44 Handle invalid mapping config files (#61)
* When a terminating newline is missing from the metric mapping configuration file, the last definition is not parsed at all. After this change the last 'METRIC_DEFINITION' in the file is equivalent to a newline (either between definitions or as the terminating newline).

* Update mapping, if we are reading the last line of the file. Otherwise we will append the mapping and lose the last label. Since we are updating the mapping in two different places a 'updateMapping' function was introduced.

* Added mapper test for config files without a terminating newline.

* Added another test case where multiple definitions are given without a final terminating newline.

* As suggested by @grobie, we should give an error when a terminating newline is missing. Updated tests accordingly.
2017-02-24 11:48:05 -04:00
Mac Browning 411b071f1f allow metrics with dashes when mapping 2015-10-09 19:38:21 -04:00
Brian Brazil a054446e2f Correct example, need to specify variables like in bash.
See http://golang.org/pkg/regexp/#Regexp.Expand
2015-04-16 23:35:46 +01:00
Julius Volz b299c8a72d Fix license headers to match LICENSE file. 2015-02-19 01:04:25 +01:00
Julius Volz 728bdc52ae Ensure valid metric names and change statsd metric escaping. 2013-07-12 14:27:51 +02:00
Julius Volz eff54bdcf9 Implement config watching and reloading. 2013-07-08 21:00:57 +02:00
Julius Volz 80d504ae46 Implement statsd-to-prometheus metric label mappings. 2013-07-05 23:03:57 +02:00