With Agent v7.17+, the DogStatsD Mapper feature allows you to convert parts of a metric name submitted to DogStatsD to tags using mapping rules with wildcard and regex patterns. For example it allows you to transform the metric:
airflow.job.duration.<JOB_TYPE>.<JOB_NAME>
into the metric airflow.job.duration with two associated tags:
The wildcard match pattern matches dot-separated metric names using * as wildcard. The metric name must be only composed of alphanumeric, ., and _ characters for this pattern to work. Groups extracted can then be expanded with one of the following:
$n format: $1, $2, $3, etc.
${n} format: ${1}, ${2}, ${3}, etc.
For instance, if you have the metric custom_metric.process.value_1.value_2 with the following mapping group configuration:
The regex match pattern matches metric names using regex patterns. Compared to the wildcard match pattern, it allows to define captured groups that contain .. Groups extracted can then be expanded with one of the following:
$n format: $1, $2, $3, etc.
${n} format: ${1}, ${2}, ${3}, etc.
For instance, if you have the metric custom_metric.process.value_1.value.with.dots._2 with the following mapping group configuration:
For the regex and wildcard match type, group collected can be expanded as tags value with an associated tag key as see above, but can also be used in the metric name parameter. For instance, if you have the metric custom_metric.process.value_1.value_2 with the following mapping group configuration: