From d19d1bcad38c70bd801433da0be29ca5b2828334 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Mon, 21 Nov 2016 15:59:03 +0100 Subject: [PATCH] discovery: move into top-level package --- .../discovery => discovery}/azure/azure.go | 0 .../discovery => discovery}/consul/consul.go | 0 .../discovery => discovery}/discovery.go | 18 +++++++++--------- {retrieval/discovery => discovery}/dns/dns.go | 0 {retrieval/discovery => discovery}/ec2/ec2.go | 0 .../discovery => discovery}/file/file.go | 0 .../discovery => discovery}/file/file_test.go | 0 discovery/file/fixtures/target_groups.json | 11 +++++++++++ discovery/file/fixtures/target_groups.yml | 5 +++++ {retrieval/discovery => discovery}/gce/gce.go | 0 .../kubernetes/endpoints.go | 0 .../kubernetes/endpoints_test.go | 0 .../kubernetes/kubernetes.go | 0 .../discovery => discovery}/kubernetes/node.go | 0 .../kubernetes/node_test.go | 0 .../discovery => discovery}/kubernetes/pod.go | 0 .../kubernetes/pod_test.go | 0 .../kubernetes/service.go | 0 .../kubernetes/service_test.go | 0 .../marathon/marathon.go | 0 .../marathon/marathon_test.go | 0 .../zookeeper/zookeeper.go | 0 retrieval/targetmanager.go | 2 +- retrieval/targetmanager_test.go | 2 +- 24 files changed, 27 insertions(+), 11 deletions(-) rename {retrieval/discovery => discovery}/azure/azure.go (100%) rename {retrieval/discovery => discovery}/consul/consul.go (100%) rename {retrieval/discovery => discovery}/discovery.go (87%) rename {retrieval/discovery => discovery}/dns/dns.go (100%) rename {retrieval/discovery => discovery}/ec2/ec2.go (100%) rename {retrieval/discovery => discovery}/file/file.go (100%) rename {retrieval/discovery => discovery}/file/file_test.go (100%) create mode 100644 discovery/file/fixtures/target_groups.json create mode 100644 discovery/file/fixtures/target_groups.yml rename {retrieval/discovery => discovery}/gce/gce.go (100%) rename {retrieval/discovery => discovery}/kubernetes/endpoints.go (100%) rename {retrieval/discovery => discovery}/kubernetes/endpoints_test.go (100%) rename {retrieval/discovery => discovery}/kubernetes/kubernetes.go (100%) rename {retrieval/discovery => discovery}/kubernetes/node.go (100%) rename {retrieval/discovery => discovery}/kubernetes/node_test.go (100%) rename {retrieval/discovery => discovery}/kubernetes/pod.go (100%) rename {retrieval/discovery => discovery}/kubernetes/pod_test.go (100%) rename {retrieval/discovery => discovery}/kubernetes/service.go (100%) rename {retrieval/discovery => discovery}/kubernetes/service_test.go (100%) rename {retrieval/discovery => discovery}/marathon/marathon.go (100%) rename {retrieval/discovery => discovery}/marathon/marathon_test.go (100%) rename {retrieval/discovery => discovery}/zookeeper/zookeeper.go (100%) 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" )