|
|
|
@ -30,7 +30,9 @@ import (
|
|
|
|
|
"github.com/prometheus/prometheus/discovery/azure" |
|
|
|
|
sd_config "github.com/prometheus/prometheus/discovery/config" |
|
|
|
|
"github.com/prometheus/prometheus/discovery/consul" |
|
|
|
|
"github.com/prometheus/prometheus/discovery/digitalocean" |
|
|
|
|
"github.com/prometheus/prometheus/discovery/dns" |
|
|
|
|
"github.com/prometheus/prometheus/discovery/dockerswarm" |
|
|
|
|
"github.com/prometheus/prometheus/discovery/ec2" |
|
|
|
|
"github.com/prometheus/prometheus/discovery/file" |
|
|
|
|
"github.com/prometheus/prometheus/discovery/kubernetes" |
|
|
|
@ -605,6 +607,49 @@ 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", |
|
|
|
|
|
|
|
|
|
HonorTimestamps: true, |
|
|
|
|
ScrapeInterval: model.Duration(15 * time.Second), |
|
|
|
|
ScrapeTimeout: DefaultGlobalConfig.ScrapeTimeout, |
|
|
|
|
|
|
|
|
|
MetricsPath: DefaultScrapeConfig.MetricsPath, |
|
|
|
|
Scheme: DefaultScrapeConfig.Scheme, |
|
|
|
|
|
|
|
|
|
ServiceDiscoveryConfig: sd_config.ServiceDiscoveryConfig{ |
|
|
|
|
DockerSwarmSDConfigs: []*dockerswarm.SDConfig{ |
|
|
|
|
{ |
|
|
|
|
Host: "http://127.0.0.1:2375", |
|
|
|
|
Role: "nodes", |
|
|
|
|
Port: 80, |
|
|
|
|
RefreshInterval: model.Duration(60 * time.Second), |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
JobName: "service-openstack", |
|
|
|
|
|
|
|
|
@ -691,7 +736,7 @@ func TestElideSecrets(t *testing.T) {
|
|
|
|
|
yamlConfig := string(config) |
|
|
|
|
|
|
|
|
|
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"), |
|
|
|
|
"yaml marshal reveals authentication credentials.") |
|
|
|
|
} |
|
|
|
|