Add url tag only if not already set
This commit is contained in:
@@ -24,9 +24,6 @@ type HTTP struct {
|
||||
Username string
|
||||
Password string
|
||||
|
||||
// Option to add "url" tag to each metric
|
||||
TagURL bool `toml:"tag_url"`
|
||||
|
||||
// Path to CA file
|
||||
SSLCA string `toml:"ssl_ca"`
|
||||
// Path to host cert file
|
||||
@@ -183,7 +180,7 @@ func (h *HTTP) gatherURL(
|
||||
}
|
||||
|
||||
for _, metric := range metrics {
|
||||
if h.TagURL {
|
||||
if !metric.HasTag("url") {
|
||||
metric.AddTag("url", url)
|
||||
}
|
||||
acc.AddFields(metric.Name(), metric.Fields(), metric.Tags(), metric.Time())
|
||||
|
||||
Reference in New Issue
Block a user