mirror of https://github.com/prometheus/prometheus
config: extend and format config example/test.
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: "",
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,71 +5,75 @@ global:
|
||||||
# scrape_timeout is set to the global default (10s).
|
# scrape_timeout is set to the global default (10s).
|
||||||
|
|
||||||
labels:
|
labels:
|
||||||
monitor: codelab
|
monitor: codelab
|
||||||
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).
|
||||||
|
|
||||||
# metrics_path defaults to '/metrics'
|
# metrics_path defaults to '/metrics'
|
||||||
# scheme defaults to 'http'.
|
# scheme defaults to 'http'.
|
||||||
|
|
||||||
|
file_sd_configs:
|
||||||
|
- names:
|
||||||
|
- foo/*.slow.json
|
||||||
|
- foo/*.slow.yml
|
||||||
|
- single/file.yml
|
||||||
|
refresh_interval: 10m
|
||||||
|
- names:
|
||||||
|
- bar/*.yaml
|
||||||
|
|
||||||
|
target_groups:
|
||||||
|
- targets: ['localhost:9090', 'localhost:9191']
|
||||||
labels:
|
labels:
|
||||||
foo: baz
|
my: label
|
||||||
|
your: label
|
||||||
|
|
||||||
file_sd_configs:
|
relabel_configs:
|
||||||
- names:
|
- source_labels: [job, __meta_dns_srv_name]
|
||||||
- foo/*.slow.json
|
regex: (.*)some-[regex]$
|
||||||
- foo/*.slow.yml
|
target_label: job
|
||||||
- single/file.yml
|
replacement: foo-${1}
|
||||||
refresh_interval: 10m
|
# action defaults to 'replace'
|
||||||
- names:
|
|
||||||
- bar/*.yaml
|
|
||||||
|
|
||||||
target_groups:
|
|
||||||
- targets: ['localhost:9090', 'localhost:9191']
|
|
||||||
labels:
|
|
||||||
my: label
|
|
||||||
your: label
|
|
||||||
|
|
||||||
relabel_configs:
|
|
||||||
- source_labels: [job, __meta_dns_srv_name]
|
|
||||||
regex: (.*)some-[regex]$
|
|
||||||
target_label: job
|
|
||||||
replacement: foo-${1}
|
|
||||||
# action defaults to 'replace'
|
|
||||||
|
|
||||||
|
|
||||||
- job_name: service-x
|
- job_name: service-x
|
||||||
|
|
||||||
basic_auth:
|
basic_auth:
|
||||||
username: admin
|
username: admin
|
||||||
password: password
|
password: password
|
||||||
|
|
||||||
scrape_interval: 50s
|
scrape_interval: 50s
|
||||||
scrape_timeout: 5s
|
scrape_timeout: 5s
|
||||||
|
|
||||||
metrics_path: /my_path
|
metrics_path: /my_path
|
||||||
scheme: https
|
scheme: https
|
||||||
|
|
||||||
dns_sd_configs:
|
dns_sd_configs:
|
||||||
- refresh_interval: 15s
|
- refresh_interval: 15s
|
||||||
names:
|
names:
|
||||||
- first.dns.address.domain.com
|
- first.dns.address.domain.com
|
||||||
- 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.
|
# refresh_interval defaults to 30s.
|
||||||
|
|
||||||
relabel_configs:
|
relabel_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 New Issue