mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Add config tests for kuma SD
Signed-off-by: austin ce <austin.cawley@gmail.com>
This commit is contained in:
parent
0544bdd6af
commit
bbc951f50b
|
@ -48,6 +48,7 @@ import (
|
||||||
"github.com/prometheus/prometheus/discovery/scaleway"
|
"github.com/prometheus/prometheus/discovery/scaleway"
|
||||||
"github.com/prometheus/prometheus/discovery/targetgroup"
|
"github.com/prometheus/prometheus/discovery/targetgroup"
|
||||||
"github.com/prometheus/prometheus/discovery/triton"
|
"github.com/prometheus/prometheus/discovery/triton"
|
||||||
|
"github.com/prometheus/prometheus/discovery/xds"
|
||||||
"github.com/prometheus/prometheus/discovery/zookeeper"
|
"github.com/prometheus/prometheus/discovery/zookeeper"
|
||||||
"github.com/prometheus/prometheus/pkg/labels"
|
"github.com/prometheus/prometheus/pkg/labels"
|
||||||
"github.com/prometheus/prometheus/pkg/relabel"
|
"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",
|
JobName: "service-marathon",
|
||||||
|
|
||||||
|
|
6
config/testdata/conf.good.yml
vendored
6
config/testdata/conf.good.yml
vendored
|
@ -109,7 +109,6 @@ scrape_configs:
|
||||||
- second.dns.address.domain.com
|
- second.dns.address.domain.com
|
||||||
- names:
|
- names:
|
||||||
- first.dns.address.domain.com
|
- first.dns.address.domain.com
|
||||||
# refresh_interval defaults to 30s.
|
|
||||||
|
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- source_labels: [job]
|
- source_labels: [job]
|
||||||
|
@ -193,6 +192,11 @@ scrape_configs:
|
||||||
username: "myusername"
|
username: "myusername"
|
||||||
password_file: valid_password_file
|
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
|
- job_name: service-marathon
|
||||||
marathon_sd_configs:
|
marathon_sd_configs:
|
||||||
- servers:
|
- servers:
|
||||||
|
|
3
config/testdata/roundtrip.good.yml
vendored
3
config/testdata/roundtrip.good.yml
vendored
|
@ -106,6 +106,9 @@ scrape_configs:
|
||||||
username: username
|
username: username
|
||||||
password_file: valid_password_file
|
password_file: valid_password_file
|
||||||
|
|
||||||
|
kuma_sd_configs:
|
||||||
|
- server: http://kuma-control-plane.kuma-system.svc:5676
|
||||||
|
|
||||||
marathon_sd_configs:
|
marathon_sd_configs:
|
||||||
- servers:
|
- servers:
|
||||||
- https://marathon.example.com:443
|
- https://marathon.example.com:443
|
||||||
|
|
Loading…
Reference in a new issue