mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-12 16:44:18 -08:00
Merge pull request #9 from prometheus/prefix-ganglia-metrics
Prefix Ganglia metrics with "ganglia_".
This commit is contained in:
commit
65dc866c86
|
@ -16,9 +16,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
gangliaAddress = "127.0.0.1:8649"
|
gangliaAddress = "127.0.0.1:8649"
|
||||||
gangliaProto = "tcp"
|
gangliaProto = "tcp"
|
||||||
gangliaTimeout = 30 * time.Second
|
gangliaTimeout = 30 * time.Second
|
||||||
|
gangliaMetricsPrefix = "ganglia_"
|
||||||
)
|
)
|
||||||
|
|
||||||
type gmondCollector struct {
|
type gmondCollector struct {
|
||||||
|
@ -93,7 +94,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 := illegalCharsRE.ReplaceAllString(metric.Name, "_")
|
name := gangliaMetricsPrefix + illegalCharsRE.ReplaceAllString(metric.Name, "_")
|
||||||
|
|
||||||
var labels = map[string]string{
|
var labels = map[string]string{
|
||||||
"cluster": cluster.Name,
|
"cluster": cluster.Name,
|
||||||
|
|
Loading…
Reference in a new issue