Browse Source

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
pull/2/merge
Johannes 'fish' Ziemke 12 years ago
parent
commit
1dbe3de133
  1. 2
      exporter/gmond_collector.go
  2. 2
      exporter/munin_collector.go

2
exporter/gmond_collector.go

@ -84,7 +84,7 @@ func (c *gmondCollector) Update() (updates int, err error) {
for _, host := range cluster.Hosts { for _, host := range cluster.Hosts {
for _, metric := range host.Metrics { for _, metric := range host.Metrics {
name := strings.ToLower(metric.Name) name := strings.Replace(strings.ToLower(metric.Name), ".", "_", -1)
var labels = map[string]string{ var labels = map[string]string{
"hostname": host.Name, "hostname": host.Name,

2
exporter/munin_collector.go

@ -169,7 +169,7 @@ func (c *muninCollector) registerMetrics() (err error) {
} }
for metric, config := range configs { for metric, config := range configs {
metricName := name + "-" + metric metricName := strings.Replace(name+"-"+metric, ".", "_", -1)
desc := graphConfig["graph_title"] + ": " + config["label"] desc := graphConfig["graph_title"] + ": " + config["label"]
if config["info"] != "" { if config["info"] != "" {
desc = desc + ", " + config["info"] desc = desc + ", " + config["info"]

Loading…
Cancel
Save