mirror of
https://github.com/nshttpd/mikrotik-exporter.git
synced 2024-10-03 04:37:34 +02:00
21 lines
422 B
Go
21 lines
422 B
Go
|
package collector
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
|
||
|
"github.com/prometheus/client_golang/prometheus"
|
||
|
)
|
||
|
|
||
|
func metricStringCleanup(in string) string {
|
||
|
return strings.Replace(in, "-", "_", -1)
|
||
|
}
|
||
|
|
||
|
func descriptionForPropertyName(prefix, property string, labelNames []string) *prometheus.Desc {
|
||
|
return prometheus.NewDesc(
|
||
|
prometheus.BuildFQName(namespace, prefix, metricStringCleanup(property)),
|
||
|
property,
|
||
|
labelNames,
|
||
|
nil,
|
||
|
)
|
||
|
}
|