From 515ae0ee8911e8a15297c0bbef69d2735d5d13a2 Mon Sep 17 00:00:00 2001 From: Erick Pintor Date: Wed, 17 Jan 2018 14:30:40 -0200 Subject: [PATCH] document metric name templating for regex matches --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index b184876..91746ab 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,18 @@ mappings: provider: "$1" ``` +The metric name can also contain references to regex matches. The mapping above +could be written as: + +``` +mappings: +- match: test\.(\w+)\.(\w+)\.counter + match_type: regex + name: "${2}_counter" + labels: + provider: "$1" +``` + If the default metric help text is insufficient for your needs you may use the YAML configuration to specify a custom help text for each mapping: ```yaml