Merge pull request #1412 from prometheus/fingerprintfix

Remove fullLabels method and fix target updating
This commit is contained in:
Brian Brazil 2016-02-22 12:11:08 +00:00
commit 04946afd0a
2 changed files with 1 additions and 13 deletions

View file

@ -405,18 +405,6 @@ func (t *Target) InstanceIdentifier() string {
return t.host() return t.host()
} }
func (t *Target) fullLabels() model.LabelSet {
t.RLock()
defer t.RUnlock()
lset := t.labels.Clone()
if _, ok := lset[model.InstanceLabel]; !ok {
lset[model.InstanceLabel] = t.labels[model.AddressLabel]
}
return lset
}
// RunScraper implements Target. // RunScraper implements Target.
func (t *Target) RunScraper(sampleAppender storage.SampleAppender) { func (t *Target) RunScraper(sampleAppender storage.SampleAppender) {
defer close(t.scraperStopped) defer close(t.scraperStopped)

View file

@ -278,7 +278,7 @@ func (tm *TargetManager) updateTargetGroup(tgroup *config.TargetGroup, cfg *conf
// to build up. // to build up.
wg.Add(1) wg.Add(1)
go func(t *Target) { go func(t *Target) {
if err := match.Update(cfg, t.fullLabels(), t.metaLabels); err != nil { if err := match.Update(cfg, t.labels, t.metaLabels); err != nil {
log.Errorf("Error updating target %v: %v", t, err) log.Errorf("Error updating target %v: %v", t, err)
} }
wg.Done() wg.Done()