diff --git a/retrieval/discovery/azure/azure.go b/discovery/azure/azure.go similarity index 100% rename from retrieval/discovery/azure/azure.go rename to discovery/azure/azure.go diff --git a/retrieval/discovery/consul/consul.go b/discovery/consul/consul.go similarity index 100% rename from retrieval/discovery/consul/consul.go rename to discovery/consul/consul.go diff --git a/retrieval/discovery/discovery.go b/discovery/discovery.go similarity index 87% rename from retrieval/discovery/discovery.go rename to discovery/discovery.go index 8872978da..715681147 100644 --- a/retrieval/discovery/discovery.go +++ b/discovery/discovery.go @@ -18,15 +18,15 @@ import ( "github.com/prometheus/common/log" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/retrieval/discovery/azure" - "github.com/prometheus/prometheus/retrieval/discovery/consul" - "github.com/prometheus/prometheus/retrieval/discovery/dns" - "github.com/prometheus/prometheus/retrieval/discovery/ec2" - "github.com/prometheus/prometheus/retrieval/discovery/file" - "github.com/prometheus/prometheus/retrieval/discovery/gce" - "github.com/prometheus/prometheus/retrieval/discovery/kubernetes" - "github.com/prometheus/prometheus/retrieval/discovery/marathon" - "github.com/prometheus/prometheus/retrieval/discovery/zookeeper" + "github.com/prometheus/prometheus/discovery/azure" + "github.com/prometheus/prometheus/discovery/consul" + "github.com/prometheus/prometheus/discovery/dns" + "github.com/prometheus/prometheus/discovery/ec2" + "github.com/prometheus/prometheus/discovery/file" + "github.com/prometheus/prometheus/discovery/gce" + "github.com/prometheus/prometheus/discovery/kubernetes" + "github.com/prometheus/prometheus/discovery/marathon" + "github.com/prometheus/prometheus/discovery/zookeeper" "golang.org/x/net/context" ) diff --git a/retrieval/discovery/dns/dns.go b/discovery/dns/dns.go similarity index 100% rename from retrieval/discovery/dns/dns.go rename to discovery/dns/dns.go diff --git a/retrieval/discovery/ec2/ec2.go b/discovery/ec2/ec2.go similarity index 100% rename from retrieval/discovery/ec2/ec2.go rename to discovery/ec2/ec2.go diff --git a/retrieval/discovery/file/file.go b/discovery/file/file.go similarity index 100% rename from retrieval/discovery/file/file.go rename to discovery/file/file.go diff --git a/retrieval/discovery/file/file_test.go b/discovery/file/file_test.go similarity index 100% rename from retrieval/discovery/file/file_test.go rename to discovery/file/file_test.go diff --git a/discovery/file/fixtures/target_groups.json b/discovery/file/fixtures/target_groups.json new file mode 100644 index 000000000..df4f0df19 --- /dev/null +++ b/discovery/file/fixtures/target_groups.json @@ -0,0 +1,11 @@ +[ + { + "targets": ["localhost:9090", "example.org:443"], + "labels": { + "foo": "bar" + } + }, + { + "targets": ["my.domain"] + } +] diff --git a/discovery/file/fixtures/target_groups.yml b/discovery/file/fixtures/target_groups.yml new file mode 100644 index 000000000..5a4e6e5db --- /dev/null +++ b/discovery/file/fixtures/target_groups.yml @@ -0,0 +1,5 @@ +- targets: ['localhost:9090', 'example.org:443'] + labels: + foo: bar + +- targets: ['my.domain'] diff --git a/retrieval/discovery/gce/gce.go b/discovery/gce/gce.go similarity index 100% rename from retrieval/discovery/gce/gce.go rename to discovery/gce/gce.go diff --git a/retrieval/discovery/kubernetes/endpoints.go b/discovery/kubernetes/endpoints.go similarity index 100% rename from retrieval/discovery/kubernetes/endpoints.go rename to discovery/kubernetes/endpoints.go diff --git a/retrieval/discovery/kubernetes/endpoints_test.go b/discovery/kubernetes/endpoints_test.go similarity index 100% rename from retrieval/discovery/kubernetes/endpoints_test.go rename to discovery/kubernetes/endpoints_test.go diff --git a/retrieval/discovery/kubernetes/kubernetes.go b/discovery/kubernetes/kubernetes.go similarity index 100% rename from retrieval/discovery/kubernetes/kubernetes.go rename to discovery/kubernetes/kubernetes.go diff --git a/retrieval/discovery/kubernetes/node.go b/discovery/kubernetes/node.go similarity index 100% rename from retrieval/discovery/kubernetes/node.go rename to discovery/kubernetes/node.go diff --git a/retrieval/discovery/kubernetes/node_test.go b/discovery/kubernetes/node_test.go similarity index 100% rename from retrieval/discovery/kubernetes/node_test.go rename to discovery/kubernetes/node_test.go diff --git a/retrieval/discovery/kubernetes/pod.go b/discovery/kubernetes/pod.go similarity index 100% rename from retrieval/discovery/kubernetes/pod.go rename to discovery/kubernetes/pod.go diff --git a/retrieval/discovery/kubernetes/pod_test.go b/discovery/kubernetes/pod_test.go similarity index 100% rename from retrieval/discovery/kubernetes/pod_test.go rename to discovery/kubernetes/pod_test.go diff --git a/retrieval/discovery/kubernetes/service.go b/discovery/kubernetes/service.go similarity index 100% rename from retrieval/discovery/kubernetes/service.go rename to discovery/kubernetes/service.go diff --git a/retrieval/discovery/kubernetes/service_test.go b/discovery/kubernetes/service_test.go similarity index 100% rename from retrieval/discovery/kubernetes/service_test.go rename to discovery/kubernetes/service_test.go diff --git a/retrieval/discovery/marathon/marathon.go b/discovery/marathon/marathon.go similarity index 100% rename from retrieval/discovery/marathon/marathon.go rename to discovery/marathon/marathon.go diff --git a/retrieval/discovery/marathon/marathon_test.go b/discovery/marathon/marathon_test.go similarity index 100% rename from retrieval/discovery/marathon/marathon_test.go rename to discovery/marathon/marathon_test.go diff --git a/retrieval/discovery/zookeeper/zookeeper.go b/discovery/zookeeper/zookeeper.go similarity index 100% rename from retrieval/discovery/zookeeper/zookeeper.go rename to discovery/zookeeper/zookeeper.go diff --git a/retrieval/targetmanager.go b/retrieval/targetmanager.go index 4f4fe3159..8df1f3b22 100644 --- a/retrieval/targetmanager.go +++ b/retrieval/targetmanager.go @@ -26,8 +26,8 @@ import ( "golang.org/x/net/context" "github.com/prometheus/prometheus/config" + "github.com/prometheus/prometheus/discovery" "github.com/prometheus/prometheus/relabel" - "github.com/prometheus/prometheus/retrieval/discovery" "github.com/prometheus/prometheus/storage" ) diff --git a/retrieval/targetmanager_test.go b/retrieval/targetmanager_test.go index 35163e947..7b04f1524 100644 --- a/retrieval/targetmanager_test.go +++ b/retrieval/targetmanager_test.go @@ -22,7 +22,7 @@ import ( "github.com/prometheus/common/model" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/retrieval/discovery" + "github.com/prometheus/prometheus/discovery" "github.com/prometheus/prometheus/storage/local" )