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: "",
|
original: "",
|
||||||
}
|
}
|
||||||
|
|
20
config/testdata/conf.good.yml
vendored
20
config/testdata/conf.good.yml
vendored
|
@ -9,12 +9,12 @@ global:
|
||||||
foo: bar
|
foo: bar
|
||||||
|
|
||||||
rule_files:
|
rule_files:
|
||||||
- "first.rules"
|
- "first.rules"
|
||||||
- "second.rules"
|
- "second.rules"
|
||||||
- "my/*.rules"
|
- "my/*.rules"
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: prometheus
|
- job_name: prometheus
|
||||||
|
|
||||||
# scrape_interval is defined by the configured global (15s).
|
# scrape_interval is defined by the configured global (15s).
|
||||||
# scrape_timeout is defined by the global default (10s).
|
# scrape_timeout is defined by the global default (10s).
|
||||||
|
@ -22,9 +22,6 @@ scrape_configs:
|
||||||
# metrics_path defaults to '/metrics'
|
# metrics_path defaults to '/metrics'
|
||||||
# scheme defaults to 'http'.
|
# scheme defaults to 'http'.
|
||||||
|
|
||||||
labels:
|
|
||||||
foo: baz
|
|
||||||
|
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
- names:
|
- names:
|
||||||
- foo/*.slow.json
|
- foo/*.slow.json
|
||||||
|
@ -48,7 +45,7 @@ scrape_configs:
|
||||||
# action defaults to 'replace'
|
# action defaults to 'replace'
|
||||||
|
|
||||||
|
|
||||||
- job_name: service-x
|
- job_name: service-x
|
||||||
|
|
||||||
basic_auth:
|
basic_auth:
|
||||||
username: admin
|
username: admin
|
||||||
|
@ -73,3 +70,10 @@ scrape_configs:
|
||||||
- source_labels: [job]
|
- source_labels: [job]
|
||||||
regex: (.*)some-[regex]$
|
regex: (.*)some-[regex]$
|
||||||
action: drop
|
action: drop
|
||||||
|
|
||||||
|
|
||||||
|
- job_name: service-y
|
||||||
|
|
||||||
|
consul_sd_configs:
|
||||||
|
- server: 'localhost:1234'
|
||||||
|
services: ['nginx', 'cache', 'mysql']
|
Loading…
Reference in a new issue