prometheus / graphite_exporter

Server that accepts metrics via the Graphite protocol and exports them as Prometheus metrics
Apache License 2.0
356 stars 100 forks source link

Support underscores in metric name components #81

Open matthiasr opened 5 years ago

matthiasr commented 5 years ago

Break-out from #80:

The exporter's metric parsing currently fails if any component of the Graphite metric name contains underscores, unless there is a mapping that constructs a valid Prometheus name.

Even without a matching mapping, the exporter should handle these metric names and translate them to valid Prometheus metric names. Existing metric names for metrics without underscores should not change when doing this.

glightfoot commented 4 years ago

@xkilian can you provide the mapping config and some more example metrics that don't work? I threw together some tests on master and it appears to work fine

xkilian commented 4 years ago

The case here, is for a metric whose name is structured like: hostname_one.source.detail_modifier.type If there is no matching mapping rule and it tries to do auto-mapping to a prometheus metric. If the mapping config drops all unmatched metrics by default, then this does not apply. I will get something together.