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
This commit is contained in:
Johannes 'fish' Ziemke 2013-05-14 16:29:29 +02:00
parent 26e294c1af
commit 1dbe3de133
2 changed files with 2 additions and 2 deletions

View File

@ -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,

View File

@ -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"]