retrieval: don't panic on non-HTTP scheme
This commit is contained in:
parent
7c237eee0e
commit
a5ba166935
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue