diff --git a/README.md b/README.md index 1bbddd7..1900b76 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,21 @@ label value are replaced by the n-th wildcard match in the matching line, starting at 1. Multiple matching definitions are separated by one or more empty lines. The first mapping rule that matches a StatsD metric wins. +Metrics that don't match any mapping in the configuration file are translated +into Prometheus metrics without any labels and with certain characters escaped +(`_` -> `__`; `-` -> `__`; `.` -> `_`). + +In general, the different metric types are translated as follows, with certain +suffixes appended to the Prometheus metric names: + + StatsD gauge -> Prometheus gauge (suffix `_gauge`) + + StatsD counter -> Prometheus counter (suffix `_counter`) + + StatsD timer -> Prometheus summary (suffix `_timer`) <-- indicates timer quantiles + -> Prometheus counter (suffix `_timer_total`) <-- indicates total time spent + -> Prometheus counter (suffix `_timer_count`) <-- indicates total number of timer events + An example mapping configuration: test.dispatcher.*.*.* @@ -59,23 +74,11 @@ An example mapping configuration: This would transform these example StatsD metrics into Prometheus metrics as follows: - test.dispatcher.FooProcessor.send.success - => dispatcher_events{processor="FooProcessor", action="send", outcome="success", job="test_dispatcher"} + test.dispatcher.FooProcessor.send.success (counter) + => dispatcher_events_counter{processor="FooProcessor", action="send", outcome="success", job="test_dispatcher"} - foo_product.signup.facebook.failure - => signup_events{provider="facebook", outcome="failure", job="foo_product_server"} - -Metrics that don't match any mapping in the configuration file are translated -into Prometheus metrics without any labels and with certain characters escaped -(`_` -> `__`; `-` -> `__`; `.` -> `_`). - -In general, the different metric types are translated as follows, with certain -suffixes appended to the Prometheus metric names: - - StatsD gauge -> Prometheus gauge (suffix `_gauge`) - - StatsD counter -> Prometheus counter (suffix `_counter`) - - StatsD timer -> Prometheus summary (suffix `_timer`) <-- indicates timer quantiles - -> Prometheus counter (suffix `_timer_total`) <-- indicates total time spent - -> Prometheus counter (suffix `_timer_count`) <-- indicates total number of timer events + foo_product.signup.facebook.failure (counter) + => signup_events_counter{provider="facebook", outcome="failure", job="foo_product_server"} + + test.web-server.foo.bar (gauge) + => test_web__server_foo_bar_gauge{}