From 772a3af38f0be72ebf7a16e090a6003bd593865e Mon Sep 17 00:00:00 2001 From: Anton Tolchanov Date: Sun, 3 Jul 2016 23:59:46 +0300 Subject: [PATCH] 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`. --- config/config.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/config.go b/config/config.go index 36847d045..f18f4f4a5 100644 --- a/config/config.go +++ b/config/config.go @@ -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), })