mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
config: extend and format config example/test.
This commit is contained in:
parent
6bb5e3f8cd
commit
3a24a7779d
|
@ -115,6 +115,24 @@ var expectedConf = &Config{
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
JobName: "service-y",
|
||||
|
||||
ScrapeInterval: Duration(15 * time.Second),
|
||||
ScrapeTimeout: DefaultGlobalConfig.ScrapeTimeout,
|
||||
|
||||
MetricsPath: DefaultScrapeConfig.MetricsPath,
|
||||
Scheme: DefaultScrapeConfig.Scheme,
|
||||
|
||||
ConsulSDConfigs: []*ConsulSDConfig{
|
||||
{
|
||||
Server: "localhost:1234",
|
||||
Services: []string{"nginx", "cache", "mysql"},
|
||||
TagSeparator: DefaultConsulSDConfig.TagSeparator,
|
||||
Scheme: DefaultConsulSDConfig.Scheme,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
original: "",
|
||||
}
|
||||
|
|
20
config/testdata/conf.good.yml
vendored
20
config/testdata/conf.good.yml
vendored
|
@ -9,12 +9,12 @@ global:
|
|||
foo: bar
|
||||
|
||||
rule_files:
|
||||
- "first.rules"
|
||||
- "second.rules"
|
||||
- "my/*.rules"
|
||||
- "first.rules"
|
||||
- "second.rules"
|
||||
- "my/*.rules"
|
||||
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
- job_name: prometheus
|
||||
|
||||
# scrape_interval is defined by the configured global (15s).
|
||||
# scrape_timeout is defined by the global default (10s).
|
||||
|
@ -22,9 +22,6 @@ scrape_configs:
|
|||
# metrics_path defaults to '/metrics'
|
||||
# scheme defaults to 'http'.
|
||||
|
||||
labels:
|
||||
foo: baz
|
||||
|
||||
file_sd_configs:
|
||||
- names:
|
||||
- foo/*.slow.json
|
||||
|
@ -48,7 +45,7 @@ scrape_configs:
|
|||
# action defaults to 'replace'
|
||||
|
||||
|
||||
- job_name: service-x
|
||||
- job_name: service-x
|
||||
|
||||
basic_auth:
|
||||
username: admin
|
||||
|
@ -73,3 +70,10 @@ scrape_configs:
|
|||
- source_labels: [job]
|
||||
regex: (.*)some-[regex]$
|
||||
action: drop
|
||||
|
||||
|
||||
- job_name: service-y
|
||||
|
||||
consul_sd_configs:
|
||||
- server: 'localhost:1234'
|
||||
services: ['nginx', 'cache', 'mysql']
|
Loading…
Reference in a new issue