parent
83a2e52bc2
commit
f9d8e5245a
@ -0,0 +1,19 @@ |
||||
- 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/kubernetes |
||||
- github.com/prometheus/prometheus/discovery/linode |
||||
- github.com/prometheus/prometheus/discovery/marathon |
||||
- github.com/prometheus/prometheus/discovery/moby |
||||
- github.com/prometheus/prometheus/discovery/openstack |
||||
- github.com/prometheus/prometheus/discovery/puppetdb |
||||
- github.com/prometheus/prometheus/discovery/scaleway |
||||
- github.com/prometheus/prometheus/discovery/triton |
||||
- github.com/prometheus/prometheus/discovery/uyuni |
||||
- github.com/prometheus/prometheus/discovery/xds |
||||
- github.com/prometheus/prometheus/discovery/zookeeper |
@ -0,0 +1,101 @@ |
||||
// Copyright 2022 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
|
||||
// +build plugins
|
||||
|
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
"io/ioutil" |
||||
"log" |
||||
"os" |
||||
"path" |
||||
"path/filepath" |
||||
|
||||
"gopkg.in/yaml.v2" |
||||
) |
||||
|
||||
//go:generate go run generate.go
|
||||
|
||||
func main() { |
||||
data, err := ioutil.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 2022 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.
|
||||
|
||||
// This file is generated by "make plugins".
|
||||
|
||||
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 i, 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) |
||||
} |
||||
if i < len(plugins)-1 { |
||||
_, err = f.WriteString("\n") |
||||
if err != nil { |
||||
log.Fatal(err) |
||||
} |
||||
} |
||||
} |
||||
|
||||
_, err = f.WriteString(")\n") |
||||
if err != nil { |
||||
log.Fatal(err) |
||||
} |
||||
} |
@ -0,0 +1,19 @@ |
||||
// Copyright 2022 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.
|
||||
|
||||
package plugins |
||||
|
||||
import ( |
||||
_ "github.com/prometheus/prometheus/discovery/file" // Register file plugin.
|
||||
_ "github.com/prometheus/prometheus/discovery/http" // Register http plugin.
|
||||
) |
@ -0,0 +1,75 @@ |
||||
// Copyright 2022 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.
|
||||
|
||||
// This file is generated by "make plugins".
|
||||
|
||||
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 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 openstack plugin.
|
||||
_ "github.com/prometheus/prometheus/discovery/openstack" |
||||
|
||||
// Register puppetdb plugin.
|
||||
_ "github.com/prometheus/prometheus/discovery/puppetdb" |
||||
|
||||
// Register scaleway plugin.
|
||||
_ "github.com/prometheus/prometheus/discovery/scaleway" |
||||
|
||||
// Register triton plugin.
|
||||
_ "github.com/prometheus/prometheus/discovery/triton" |
||||
|
||||
// Register uyuni plugin.
|
||||
_ "github.com/prometheus/prometheus/discovery/uyuni" |
||||
|
||||
// Register xds plugin.
|
||||
_ "github.com/prometheus/prometheus/discovery/xds" |
||||
|
||||
// Register zookeeper plugin.
|
||||
_ "github.com/prometheus/prometheus/discovery/zookeeper" |
||||
) |
Loading…
Reference in new issue