mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 22:37:27 -08:00
Add digitalocean test
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
a197508d09
commit
f8ec72d730
|
@ -30,6 +30,7 @@ import (
|
||||||
"github.com/prometheus/prometheus/discovery/azure"
|
"github.com/prometheus/prometheus/discovery/azure"
|
||||||
sd_config "github.com/prometheus/prometheus/discovery/config"
|
sd_config "github.com/prometheus/prometheus/discovery/config"
|
||||||
"github.com/prometheus/prometheus/discovery/consul"
|
"github.com/prometheus/prometheus/discovery/consul"
|
||||||
|
"github.com/prometheus/prometheus/discovery/digitalocean"
|
||||||
"github.com/prometheus/prometheus/discovery/dns"
|
"github.com/prometheus/prometheus/discovery/dns"
|
||||||
"github.com/prometheus/prometheus/discovery/dockerswarm"
|
"github.com/prometheus/prometheus/discovery/dockerswarm"
|
||||||
"github.com/prometheus/prometheus/discovery/ec2"
|
"github.com/prometheus/prometheus/discovery/ec2"
|
||||||
|
@ -606,6 +607,28 @@ var expectedConf = &Config{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
JobName: "digitalocean-droplets",
|
||||||
|
|
||||||
|
HonorTimestamps: true,
|
||||||
|
ScrapeInterval: model.Duration(15 * time.Second),
|
||||||
|
ScrapeTimeout: DefaultGlobalConfig.ScrapeTimeout,
|
||||||
|
|
||||||
|
MetricsPath: DefaultScrapeConfig.MetricsPath,
|
||||||
|
Scheme: DefaultScrapeConfig.Scheme,
|
||||||
|
|
||||||
|
ServiceDiscoveryConfig: sd_config.ServiceDiscoveryConfig{
|
||||||
|
DigitalOceanSDConfigs: []*digitalocean.SDConfig{
|
||||||
|
{
|
||||||
|
HTTPClientConfig: config_util.HTTPClientConfig{
|
||||||
|
BearerToken: "abcdef",
|
||||||
|
},
|
||||||
|
Port: 80,
|
||||||
|
RefreshInterval: model.Duration(60 * time.Second),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
JobName: "dockerswarm",
|
JobName: "dockerswarm",
|
||||||
|
|
||||||
|
@ -713,7 +736,7 @@ func TestElideSecrets(t *testing.T) {
|
||||||
yamlConfig := string(config)
|
yamlConfig := string(config)
|
||||||
|
|
||||||
matches := secretRe.FindAllStringIndex(yamlConfig, -1)
|
matches := secretRe.FindAllStringIndex(yamlConfig, -1)
|
||||||
testutil.Assert(t, len(matches) == 7, "wrong number of secret matches found")
|
testutil.Assert(t, len(matches) == 8, "wrong number of secret matches found")
|
||||||
testutil.Assert(t, !strings.Contains(yamlConfig, "mysecret"),
|
testutil.Assert(t, !strings.Contains(yamlConfig, "mysecret"),
|
||||||
"yaml marshal reveals authentication credentials.")
|
"yaml marshal reveals authentication credentials.")
|
||||||
}
|
}
|
||||||
|
|
4
config/testdata/conf.good.yml
vendored
4
config/testdata/conf.good.yml
vendored
|
@ -259,6 +259,10 @@ scrape_configs:
|
||||||
cert_file: valid_cert_file
|
cert_file: valid_cert_file
|
||||||
key_file: valid_key_file
|
key_file: valid_key_file
|
||||||
|
|
||||||
|
- job_name: digitalocean-droplets
|
||||||
|
digitalocean_sd_configs:
|
||||||
|
- bearer_token: abcdef
|
||||||
|
|
||||||
- job_name: dockerswarm
|
- job_name: dockerswarm
|
||||||
dockerswarm_sd_configs:
|
dockerswarm_sd_configs:
|
||||||
- host: http://127.0.0.1:2375
|
- host: http://127.0.0.1:2375
|
||||||
|
|
Loading…
Reference in a new issue