Allow URLs in targets defined via a JSON file

This enables defining `blackbox_exporter` targets (which can be URLs,
because of relabeling) in a JSON file.

Not sure if this is the best approach, but current behaviour is
inconsistent (`UnmarshalYAML` does not have this check) and breaks
officially documented way to use `blackbox_exporter`.
This commit is contained in:
Anton Tolchanov 2016-07-03 23:59:46 +03:00
parent b3f321b38a
commit 772a3af38f
1 changed files with 0 additions and 3 deletions

View File

@ -580,9 +580,6 @@ func (tg *TargetGroup) UnmarshalJSON(b []byte) error {
}
tg.Targets = make([]model.LabelSet, 0, len(g.Targets))
for _, t := range g.Targets {
if strings.Contains(t, "/") {
return fmt.Errorf("%q is not a valid hostname", t)
}
tg.Targets = append(tg.Targets, model.LabelSet{
model.AddressLabel: model.LabelValue(t),
})