From 1dbe3de133a347f5b95cec3ff4b8d7104df6352b Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Tue, 14 May 2013 16:29:29 +0200 Subject: [PATCH] Replace . in metric names by _. Because: "We are using a period to separate between the job name and the metric name in shorthand; thusly, a metric ought not have a period in it." - Matt --- exporter/gmond_collector.go | 2 +- exporter/munin_collector.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter/gmond_collector.go b/exporter/gmond_collector.go index e9d263ea..1425cb93 100644 --- a/exporter/gmond_collector.go +++ b/exporter/gmond_collector.go @@ -84,7 +84,7 @@ func (c *gmondCollector) Update() (updates int, err error) { for _, host := range cluster.Hosts { for _, metric := range host.Metrics { - name := strings.ToLower(metric.Name) + name := strings.Replace(strings.ToLower(metric.Name), ".", "_", -1) var labels = map[string]string{ "hostname": host.Name, diff --git a/exporter/munin_collector.go b/exporter/munin_collector.go index 3e564263..8fe71728 100644 --- a/exporter/munin_collector.go +++ b/exporter/munin_collector.go @@ -169,7 +169,7 @@ func (c *muninCollector) registerMetrics() (err error) { } for metric, config := range configs { - metricName := name + "-" + metric + metricName := strings.Replace(name+"-"+metric, ".", "_", -1) desc := graphConfig["graph_title"] + ": " + config["label"] if config["info"] != "" { desc = desc + ", " + config["info"]