Merge pull request #1664 from prometheus/fabxc-scheme-panic

retrieval: don't panic on non-HTTP scheme
This commit is contained in:
Brian Brazil 2016-05-26 00:19:04 +01:00
commit e222e17073

View file

@ -454,7 +454,7 @@ func targetsFromGroup(tg *config.TargetGroup, cfg *config.ScrapeConfig) ([]*Targ
case "https":
addr = fmt.Sprintf("%s:443", addr)
default:
panic(fmt.Errorf("targetsFromGroup: invalid scheme %q", cfg.Scheme))
return nil, fmt.Errorf("invalid scheme: %q", cfg.Scheme)
}
labels[model.AddressLabel] = model.LabelValue(addr)
}