diff --git a/config/config_test.go b/config/config_test.go index afdfcbc521..0d569c59f3 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -48,6 +48,7 @@ import ( "github.com/prometheus/prometheus/discovery/scaleway" "github.com/prometheus/prometheus/discovery/targetgroup" "github.com/prometheus/prometheus/discovery/triton" + "github.com/prometheus/prometheus/discovery/xds" "github.com/prometheus/prometheus/discovery/zookeeper" "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/pkg/relabel" @@ -439,6 +440,26 @@ var expectedConf = &Config{ }, }, }, + { + JobName: "service-kuma", + + HonorTimestamps: true, + ScrapeInterval: model.Duration(15 * time.Second), + ScrapeTimeout: DefaultGlobalConfig.ScrapeTimeout, + + MetricsPath: DefaultScrapeConfig.MetricsPath, + Scheme: DefaultScrapeConfig.Scheme, + HTTPClientConfig: config.DefaultHTTPClientConfig, + + ServiceDiscoveryConfigs: discovery.Configs{ + &xds.KumaSDConfig{ + Server: "http://kuma-control-plane.kuma-system.svc:5676", + HTTPClientConfig: config.DefaultHTTPClientConfig, + RefreshInterval: model.Duration(15 * time.Second), + FetchTimeout: model.Duration(2 * time.Minute), + }, + }, + }, { JobName: "service-marathon", diff --git a/config/testdata/conf.good.yml b/config/testdata/conf.good.yml index a72031de31..19fe0c9b21 100644 --- a/config/testdata/conf.good.yml +++ b/config/testdata/conf.good.yml @@ -109,7 +109,6 @@ scrape_configs: - second.dns.address.domain.com - names: - first.dns.address.domain.com - # refresh_interval defaults to 30s. relabel_configs: - source_labels: [job] @@ -193,6 +192,11 @@ scrape_configs: username: "myusername" password_file: valid_password_file + - job_name: service-kuma + + kuma_sd_configs: + - server: http://kuma-control-plane.kuma-system.svc:5676 + - job_name: service-marathon marathon_sd_configs: - servers: diff --git a/config/testdata/roundtrip.good.yml b/config/testdata/roundtrip.good.yml index 51b59dd817..f2634d257a 100644 --- a/config/testdata/roundtrip.good.yml +++ b/config/testdata/roundtrip.good.yml @@ -106,6 +106,9 @@ scrape_configs: username: username password_file: valid_password_file + kuma_sd_configs: + - server: http://kuma-control-plane.kuma-system.svc:5676 + marathon_sd_configs: - servers: - https://marathon.example.com:443