Skip to content

Commit

Permalink
don't overwrite host tags in plugins
Browse files Browse the repository at this point in the history
closes #1227
closes #1210
  • Loading branch information
sparrc committed May 19, 2016
1 parent debf7bf commit 36d6d9e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions agent/accumulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,17 @@ func (ac *accumulator) AddFields(
if tags == nil {
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
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)

Expand Down

0 comments on commit 36d6d9e

Please sign in to comment.