Skip to content
Snippets Groups Projects
Commit 2e68bd14 authored by Cameron Sparr's avatar Cameron Sparr
Browse files

don't overwrite host tags in plugins

closes #1227
closes #1210
parent 35eb6546
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
- [#1195](https://github.com/influxdata/telegraf/pull/1195): Docker panic on timeout. Thanks @zstyblik! - [#1195](https://github.com/influxdata/telegraf/pull/1195): Docker panic on timeout. Thanks @zstyblik!
- [#1211](https://github.com/influxdata/telegraf/pull/1211): mongodb input. Fix possible panic. Thanks @kols! - [#1211](https://github.com/influxdata/telegraf/pull/1211): mongodb input. Fix possible panic. Thanks @kols!
- [#1228](https://github.com/influxdata/telegraf/pull/1228): Fix service plugin host tag overwrite.
## v0.13 [2016-05-11] ## v0.13 [2016-05-11]
......
...@@ -84,13 +84,17 @@ func (ac *accumulator) AddFields( ...@@ -84,13 +84,17 @@ func (ac *accumulator) AddFields(
if tags == nil { if tags == nil {
tags = make(map[string]string) tags = make(map[string]string)
} }
// Apply daemon-wide tags if set
for k, v := range ac.defaultTags {
tags[k] = v
}
// Apply plugin-wide tags if set // Apply plugin-wide tags if set
for k, v := range ac.inputConfig.Tags { for k, v := range ac.inputConfig.Tags {
tags[k] = v if _, ok := tags[k]; !ok {
tags[k] = v
}
}
// Apply daemon-wide tags if set
for k, v := range ac.defaultTags {
if _, ok := tags[k]; !ok {
tags[k] = v
}
} }
ac.inputConfig.Filter.FilterTags(tags) ac.inputConfig.Filter.FilterTags(tags)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment