Importers of pkg/exporter may not want for series to be imported into
the default registry. This commit makes it possible to provide a custom
registry for metrics registration.
Signed-off-by: Robert Fratto <robertfratto@gmail.com>
The mapper package can be used outside the statsd exporter, so it is
better to use generic names here.
Signed-off-by: Matthias Rampke <mr@soundcloud.com>
- Statsd allows users to provide a metric with the same name but
differing types (counter, gauge, timer)
- The exporter allows this by letting users specify a
"match_metric_type" in the mapping config
- However the mapper cache does not look at the metric type so it would
return a MetricMapperCacheResult for the type of the first metric with
that name that the exporter saw
- Add MetricType to the signature for the cache and format the metric
name with the type to provide unique keys for a metric with the same
name but differing type
Signed-off-by: Andy Paine <andy.paine@digital.cabinet-office.gov.uk>