mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-23 20:36:21 +01:00
Prefix Ganglia metrics with "ganglia_".
The gmond (Ganglia) exporter module exports many metrics not under our control. They should all be prefixed in a common way to make it obvious where they came from. Fixes https://github.com/prometheus/node_exporter/issues/8
This commit is contained in:
parent
c18f7ecfc6
commit
a22036788a
@ -19,6 +19,7 @@ const (
|
||||
gangliaAddress = "127.0.0.1:8649"
|
||||
gangliaProto = "tcp"
|
||||
gangliaTimeout = 30 * time.Second
|
||||
gangliaMetricsPrefix = "ganglia_"
|
||||
)
|
||||
|
||||
type gmondCollector struct {
|
||||
@ -93,7 +94,7 @@ func (c *gmondCollector) Update() (updates int, err error) {
|
||||
for _, host := range cluster.Hosts {
|
||||
|
||||
for _, metric := range host.Metrics {
|
||||
name := illegalCharsRE.ReplaceAllString(metric.Name, "_")
|
||||
name := gangliaMetricsPrefix + illegalCharsRE.ReplaceAllString(metric.Name, "_")
|
||||
|
||||
var labels = map[string]string{
|
||||
"cluster": cluster.Name,
|
||||
|
Loading…
Reference in New Issue
Block a user