summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go')
-rw-r--r--src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go b/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go
index 4bcf4b5784..bd686b3061 100644
--- a/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go
+++ b/src/go/collectors/go.d.plugin/agent/discovery/sd/pipeline/classify.go
@@ -46,10 +46,11 @@ type (
)
func (c *targetClassificator) classify(tgt model.Target) model.Tags {
+ tgtTags := tgt.Tags().Clone()
var tags model.Tags
for i, rule := range c.rules {
- if !rule.sr.matches(tgt.Tags()) {
+ if !rule.sr.matches(tgtTags) {
continue
}
@@ -70,6 +71,7 @@ func (c *targetClassificator) classify(tgt model.Target) model.Tags {
tags.Merge(rule.tags)
tags.Merge(match.tags)
+ tgtTags.Merge(tags)
}
}