Add config tests for kuma SD

Signed-off-by: austin ce <austin.cawley@gmail.com>
This commit is contained in:
austin ce 2021-05-04 15:47:44 -04:00
parent 0544bdd6af
commit bbc951f50b
No known key found for this signature in database
GPG Key ID: BACD4A6A54EBE93C
3 changed files with 29 additions and 1 deletions

View File

@ -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",

View File

@ -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:

View File

@ -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