mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Merge pull request #1412 from prometheus/fingerprintfix
Remove fullLabels method and fix target updating
This commit is contained in:
commit
04946afd0a
|
@ -405,18 +405,6 @@ func (t *Target) InstanceIdentifier() string {
|
|||
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.
|
||||
func (t *Target) RunScraper(sampleAppender storage.SampleAppender) {
|
||||
defer close(t.scraperStopped)
|
||||
|
|
|
@ -278,7 +278,7 @@ func (tm *TargetManager) updateTargetGroup(tgroup *config.TargetGroup, cfg *conf
|
|||
// to build up.
|
||||
wg.Add(1)
|
||||
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)
|
||||
}
|
||||
wg.Done()
|
||||
|
|
Loading…
Reference in a new issue