special case 'value'
it usually connotes a single value type metric, appending just clutters closes #793
This commit is contained in:
committed by
Michele Fadda
parent
dcfafd3033
commit
d01f6f0bd2
@@ -79,7 +79,12 @@ func (p *PrometheusClient) Write(metrics []telegraf.Metric) error {
|
||||
}
|
||||
|
||||
for n, val := range point.Fields() {
|
||||
mname := fmt.Sprintf("%s_%s", key, n)
|
||||
var mname string
|
||||
if n == "value" {
|
||||
mname = key
|
||||
} else {
|
||||
mname = fmt.Sprintf("%s_%s", key, n)
|
||||
}
|
||||
if _, ok := p.metrics[mname]; !ok {
|
||||
p.metrics[mname] = prometheus.NewUntypedVec(
|
||||
prometheus.UntypedOpts{
|
||||
|
||||
Reference in New Issue
Block a user