mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-23 12:30:46 +01:00
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:
parent
26e294c1af
commit
1dbe3de133
@ -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,
|
||||
|
@ -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"]
|
||||
|
Loading…
Reference in New Issue
Block a user