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:
parent
b3f321b38a
commit
772a3af38f
|
@ -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),
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue