delete tag if tagvalue is -
This commit is contained in:
parent
1860337c47
commit
7b70e7ae0b
|
@ -17,7 +17,7 @@
|
|||
# interval_times = 1
|
||||
|
||||
# important! use global unique string to specify instance
|
||||
# labels = { instance="192.168.1.2:8080", service="tomcat" }
|
||||
# labels = { instance="192.168.1.2:8080", url="-" }
|
||||
|
||||
## Optional TLS Config
|
||||
# use_tls = false
|
||||
|
|
|
@ -37,6 +37,9 @@ func NewSample(metric string, value interface{}, labels ...map[string]string) *t
|
|||
|
||||
for i := 0; i < len(labels); i++ {
|
||||
for k, v := range labels[i] {
|
||||
if v == "-" {
|
||||
continue
|
||||
}
|
||||
s.Labels[k] = v
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue