diff --git a/Makefile b/Makefile index bc5d67da6b..8c15ceb2e9 100644 --- a/Makefile +++ b/Makefile @@ -166,15 +166,8 @@ tarball: npm_licenses common-tarball .PHONY: docker docker: npm_licenses common-docker -plugins/plugins.go: plugins.yml plugins/generate.go - @echo ">> creating plugins list" - $(GO) generate -tags plugins ./plugins - -.PHONY: plugins -plugins: plugins/plugins.go - .PHONY: build -build: assets npm_licenses assets-compress plugins common-build +build: assets npm_licenses assets-compress common-build .PHONY: bench_tsdb bench_tsdb: $(PROMU) diff --git a/README.md b/README.md index ae4ae50431..7b04a51cee 100644 --- a/README.md +++ b/README.md @@ -113,16 +113,31 @@ The Makefile provides several targets: ### Service discovery plugins -Prometheus is bundled with many service discovery plugins. -When building Prometheus from source, you can edit the [plugins.yml](./plugins.yml) -file to disable some service discoveries. The file is a yaml-formatted list of go -import path that will be built into the Prometheus binary. +Prometheus is bundled with many service discovery plugins. You can customize +which service discoveries are included in your build using Go build tags. -After you have changed the file, you -need to run `make build` again. +To exclude service discoveries when building with `make build`, add the desired +tags to the `.promu.yml` file under `build.tags.all`: -If you are using another method to compile Prometheus, `make plugins` will -generate the plugins file accordingly. +```yaml +build: + tags: + all: + - netgo + - builtinassets + - remove_all_sd # Exclude all optional SDs + - enable_kubernetes_sd # Re-enable only kubernetes +``` + +Then run `make build` as usual. Alternatively, when using `go build` directly: + +```bash +go build -tags "remove_all_sd,enable_kubernetes_sd" ./cmd/prometheus +``` + +Available build tags: +* `remove_all_sd` - Exclude all optional service discoveries (keeps file_sd, static_sd, and http_sd) +* `enable__sd` - Re-enable a specific SD when using `remove_all_sd` If you add out-of-tree plugins, which we do not endorse at the moment, additional steps might be needed to adjust the `go.mod` and `go.sum` files. As diff --git a/plugins.yml b/plugins.yml deleted file mode 100644 index 0541fe4852..0000000000 --- a/plugins.yml +++ /dev/null @@ -1,24 +0,0 @@ -- github.com/prometheus/prometheus/discovery/aws -- github.com/prometheus/prometheus/discovery/azure -- github.com/prometheus/prometheus/discovery/consul -- github.com/prometheus/prometheus/discovery/digitalocean -- github.com/prometheus/prometheus/discovery/dns -- github.com/prometheus/prometheus/discovery/eureka -- github.com/prometheus/prometheus/discovery/gce -- github.com/prometheus/prometheus/discovery/hetzner -- github.com/prometheus/prometheus/discovery/ionos -- github.com/prometheus/prometheus/discovery/kubernetes -- github.com/prometheus/prometheus/discovery/linode -- github.com/prometheus/prometheus/discovery/marathon -- github.com/prometheus/prometheus/discovery/moby -- github.com/prometheus/prometheus/discovery/nomad -- github.com/prometheus/prometheus/discovery/openstack -- github.com/prometheus/prometheus/discovery/ovhcloud -- github.com/prometheus/prometheus/discovery/puppetdb -- github.com/prometheus/prometheus/discovery/scaleway -- github.com/prometheus/prometheus/discovery/stackit -- github.com/prometheus/prometheus/discovery/triton -- github.com/prometheus/prometheus/discovery/uyuni -- github.com/prometheus/prometheus/discovery/vultr -- github.com/prometheus/prometheus/discovery/xds -- github.com/prometheus/prometheus/discovery/zookeeper diff --git a/plugins/generate.go b/plugins/generate.go deleted file mode 100644 index c0e58ec83b..0000000000 --- a/plugins/generate.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build plugins - -package main - -import ( - "fmt" - "log" - "os" - "path" - "path/filepath" - - "go.yaml.in/yaml/v2" -) - -//go:generate go run generate.go - -func main() { - data, err := os.ReadFile(filepath.Join("..", "plugins.yml")) - if err != nil { - log.Fatal(err) - } - - var plugins []string - err = yaml.Unmarshal(data, &plugins) - if err != nil { - log.Fatal(err) - } - - f, err := os.Create("plugins.go") - if err != nil { - log.Fatal(err) - } - defer f.Close() - _, err = f.WriteString(`// Copyright The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by "make plugins". DO NOT EDIT. - -package plugins - -`) - if err != nil { - log.Fatal(err) - } - - if len(plugins) == 0 { - return - } - - _, err = f.WriteString("import (\n") - if err != nil { - log.Fatal(err) - } - - for _, plugin := range plugins { - _, err = f.WriteString(fmt.Sprintf("\t// Register %s plugin.\n", path.Base(plugin))) - if err != nil { - log.Fatal(err) - } - _, err = f.WriteString(fmt.Sprintf("\t_ \"%s\"\n", plugin)) - if err != nil { - log.Fatal(err) - } - } - - _, err = f.WriteString(")\n") - if err != nil { - log.Fatal(err) - } -} diff --git a/plugins/plugin_aws.go b/plugins/plugin_aws.go new file mode 100644 index 0000000000..711ef38c3e --- /dev/null +++ b/plugins/plugin_aws.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_aws_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/aws" // Register aws plugin. +) diff --git a/plugins/plugin_azure.go b/plugins/plugin_azure.go new file mode 100644 index 0000000000..1f72812b8a --- /dev/null +++ b/plugins/plugin_azure.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_azure_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/azure" // Register azure plugin. +) diff --git a/plugins/plugin_consul.go b/plugins/plugin_consul.go new file mode 100644 index 0000000000..6ff5003041 --- /dev/null +++ b/plugins/plugin_consul.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_consul_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/consul" // Register consul plugin. +) diff --git a/plugins/plugin_digitalocean.go b/plugins/plugin_digitalocean.go new file mode 100644 index 0000000000..927180e90b --- /dev/null +++ b/plugins/plugin_digitalocean.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_digitalocean_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/digitalocean" // Register digitalocean plugin. +) diff --git a/plugins/plugin_dns.go b/plugins/plugin_dns.go new file mode 100644 index 0000000000..7bec66371e --- /dev/null +++ b/plugins/plugin_dns.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_dns_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/dns" // Register dns plugin. +) diff --git a/plugins/plugin_eureka.go b/plugins/plugin_eureka.go new file mode 100644 index 0000000000..e4011da02a --- /dev/null +++ b/plugins/plugin_eureka.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_eureka_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/eureka" // Register eureka plugin. +) diff --git a/plugins/plugin_gce.go b/plugins/plugin_gce.go new file mode 100644 index 0000000000..1c67657260 --- /dev/null +++ b/plugins/plugin_gce.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_gce_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/gce" // Register gce plugin. +) diff --git a/plugins/plugin_hetzner.go b/plugins/plugin_hetzner.go new file mode 100644 index 0000000000..f6b7db4563 --- /dev/null +++ b/plugins/plugin_hetzner.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_hetzner_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/hetzner" // Register hetzner plugin. +) diff --git a/plugins/plugin_ionos.go b/plugins/plugin_ionos.go new file mode 100644 index 0000000000..bf53b73053 --- /dev/null +++ b/plugins/plugin_ionos.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_ionos_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/ionos" // Register ionos plugin. +) diff --git a/plugins/plugin_kubernetes.go b/plugins/plugin_kubernetes.go new file mode 100644 index 0000000000..7145cedb2e --- /dev/null +++ b/plugins/plugin_kubernetes.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_kubernetes_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/kubernetes" // Register kubernetes plugin. +) diff --git a/plugins/plugin_linode.go b/plugins/plugin_linode.go new file mode 100644 index 0000000000..4eb24b409c --- /dev/null +++ b/plugins/plugin_linode.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_linode_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/linode" // Register linode plugin. +) diff --git a/plugins/plugin_marathon.go b/plugins/plugin_marathon.go new file mode 100644 index 0000000000..c26219a37a --- /dev/null +++ b/plugins/plugin_marathon.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_marathon_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/marathon" // Register marathon plugin. +) diff --git a/plugins/plugin_moby.go b/plugins/plugin_moby.go new file mode 100644 index 0000000000..2c7c8e158b --- /dev/null +++ b/plugins/plugin_moby.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_moby_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/moby" // Register moby plugin. +) diff --git a/plugins/plugin_nomad.go b/plugins/plugin_nomad.go new file mode 100644 index 0000000000..7251e507a2 --- /dev/null +++ b/plugins/plugin_nomad.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_nomad_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/nomad" // Register nomad plugin. +) diff --git a/plugins/plugin_openstack.go b/plugins/plugin_openstack.go new file mode 100644 index 0000000000..0dd227e8ac --- /dev/null +++ b/plugins/plugin_openstack.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_openstack_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/openstack" // Register openstack plugin. +) diff --git a/plugins/plugin_ovhcloud.go b/plugins/plugin_ovhcloud.go new file mode 100644 index 0000000000..e3c372db8c --- /dev/null +++ b/plugins/plugin_ovhcloud.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_ovhcloud_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/ovhcloud" // Register ovhcloud plugin. +) diff --git a/plugins/plugin_puppetdb.go b/plugins/plugin_puppetdb.go new file mode 100644 index 0000000000..33e82b6eac --- /dev/null +++ b/plugins/plugin_puppetdb.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_puppetdb_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/puppetdb" // Register puppetdb plugin. +) diff --git a/plugins/plugin_scaleway.go b/plugins/plugin_scaleway.go new file mode 100644 index 0000000000..88e58ac646 --- /dev/null +++ b/plugins/plugin_scaleway.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_scaleway_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/scaleway" // Register scaleway plugin. +) diff --git a/plugins/plugin_stackit.go b/plugins/plugin_stackit.go new file mode 100644 index 0000000000..ac19419c27 --- /dev/null +++ b/plugins/plugin_stackit.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_stackit_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/stackit" // Register stackit plugin. +) diff --git a/plugins/plugin_triton.go b/plugins/plugin_triton.go new file mode 100644 index 0000000000..48989df8dd --- /dev/null +++ b/plugins/plugin_triton.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_triton_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/triton" // Register triton plugin. +) diff --git a/plugins/plugin_uyuni.go b/plugins/plugin_uyuni.go new file mode 100644 index 0000000000..09f9ff033d --- /dev/null +++ b/plugins/plugin_uyuni.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_uyuni_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/uyuni" // Register uyuni plugin. +) diff --git a/plugins/plugin_vultr.go b/plugins/plugin_vultr.go new file mode 100644 index 0000000000..5de4747cc7 --- /dev/null +++ b/plugins/plugin_vultr.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_vultr_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/vultr" // Register vultr plugin. +) diff --git a/plugins/plugin_xds.go b/plugins/plugin_xds.go new file mode 100644 index 0000000000..e0b0f048d2 --- /dev/null +++ b/plugins/plugin_xds.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_xds_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/xds" // Register xds plugin. +) diff --git a/plugins/plugin_zookeeper.go b/plugins/plugin_zookeeper.go new file mode 100644 index 0000000000..0852432920 --- /dev/null +++ b/plugins/plugin_zookeeper.go @@ -0,0 +1,20 @@ +// Copyright The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !remove_all_sd || enable_zookeeper_sd + +package plugins + +import ( + _ "github.com/prometheus/prometheus/discovery/zookeeper" // Register zookeeper plugin. +) diff --git a/plugins/plugins.go b/plugins/plugins.go deleted file mode 100644 index 686fdfb325..0000000000 --- a/plugins/plugins.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by "make plugins". DO NOT EDIT. - -package plugins - -import ( - // Register aws plugin. - _ "github.com/prometheus/prometheus/discovery/aws" - // Register azure plugin. - _ "github.com/prometheus/prometheus/discovery/azure" - // Register consul plugin. - _ "github.com/prometheus/prometheus/discovery/consul" - // Register digitalocean plugin. - _ "github.com/prometheus/prometheus/discovery/digitalocean" - // Register dns plugin. - _ "github.com/prometheus/prometheus/discovery/dns" - // Register eureka plugin. - _ "github.com/prometheus/prometheus/discovery/eureka" - // Register gce plugin. - _ "github.com/prometheus/prometheus/discovery/gce" - // Register hetzner plugin. - _ "github.com/prometheus/prometheus/discovery/hetzner" - // Register ionos plugin. - _ "github.com/prometheus/prometheus/discovery/ionos" - // Register kubernetes plugin. - _ "github.com/prometheus/prometheus/discovery/kubernetes" - // Register linode plugin. - _ "github.com/prometheus/prometheus/discovery/linode" - // Register marathon plugin. - _ "github.com/prometheus/prometheus/discovery/marathon" - // Register moby plugin. - _ "github.com/prometheus/prometheus/discovery/moby" - // Register nomad plugin. - _ "github.com/prometheus/prometheus/discovery/nomad" - // Register openstack plugin. - _ "github.com/prometheus/prometheus/discovery/openstack" - // Register ovhcloud plugin. - _ "github.com/prometheus/prometheus/discovery/ovhcloud" - // Register puppetdb plugin. - _ "github.com/prometheus/prometheus/discovery/puppetdb" - // Register scaleway plugin. - _ "github.com/prometheus/prometheus/discovery/scaleway" - // Register stackit plugin. - _ "github.com/prometheus/prometheus/discovery/stackit" - // Register triton plugin. - _ "github.com/prometheus/prometheus/discovery/triton" - // Register uyuni plugin. - _ "github.com/prometheus/prometheus/discovery/uyuni" - // Register vultr plugin. - _ "github.com/prometheus/prometheus/discovery/vultr" - // Register xds plugin. - _ "github.com/prometheus/prometheus/discovery/xds" - // Register zookeeper plugin. - _ "github.com/prometheus/prometheus/discovery/zookeeper" -)