created docker-prometheus compose file and edited the Prometheus yml file
This commit is contained in:
6
prom/config/testdata/bearertoken.bad.yml
vendored
Normal file
6
prom/config/testdata/bearertoken.bad.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
|
||||
bearer_token: 1234
|
||||
bearer_token_file: somefile
|
||||
|
8
prom/config/testdata/bearertoken_basicauth.bad.yml
vendored
Normal file
8
prom/config/testdata/bearertoken_basicauth.bad.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
|
||||
bearer_token: 1234
|
||||
basic_auth:
|
||||
username: user
|
||||
password: password
|
||||
|
108
prom/config/testdata/conf.good.yml
vendored
Normal file
108
prom/config/testdata/conf.good.yml
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
# my global config
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 30s
|
||||
# scrape_timeout is set to the global default (10s).
|
||||
|
||||
labels:
|
||||
monitor: codelab
|
||||
foo: bar
|
||||
|
||||
rule_files:
|
||||
- "first.rules"
|
||||
- "/absolute/second.rules"
|
||||
- "my/*.rules"
|
||||
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
|
||||
honor_labels: true
|
||||
# scrape_interval is defined by the configured global (15s).
|
||||
# scrape_timeout is defined by the global default (10s).
|
||||
|
||||
# metrics_path defaults to '/metrics'
|
||||
# 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:
|
||||
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'
|
||||
|
||||
bearer_token_file: valid_token_file
|
||||
|
||||
|
||||
- job_name: service-x
|
||||
|
||||
basic_auth:
|
||||
username: admin_name
|
||||
password: admin_password
|
||||
|
||||
scrape_interval: 50s
|
||||
scrape_timeout: 5s
|
||||
|
||||
metrics_path: /my_path
|
||||
scheme: https
|
||||
|
||||
dns_sd_configs:
|
||||
- refresh_interval: 15s
|
||||
names:
|
||||
- first.dns.address.domain.com
|
||||
- second.dns.address.domain.com
|
||||
- names:
|
||||
- first.dns.address.domain.com
|
||||
# refresh_interval defaults to 30s.
|
||||
|
||||
relabel_configs:
|
||||
- source_labels: [job]
|
||||
regex: (.*)some-[regex]$
|
||||
action: drop
|
||||
- source_labels: [__address__]
|
||||
modulus: 8
|
||||
target_label: __tmp_hash
|
||||
action: hashmod
|
||||
- source_labels: [__tmp_hash]
|
||||
regex: ^1$
|
||||
action: keep
|
||||
|
||||
metric_relabel_configs:
|
||||
- source_labels: [__name__]
|
||||
regex: expensive_metric.*$
|
||||
action: drop
|
||||
|
||||
- job_name: service-y
|
||||
|
||||
consul_sd_configs:
|
||||
- server: 'localhost:1234'
|
||||
services: ['nginx', 'cache', 'mysql']
|
||||
|
||||
- job_name: service-z
|
||||
|
||||
client_cert:
|
||||
cert: valid_cert_file
|
||||
key: valid_key_file
|
||||
|
||||
bearer_token: avalidtoken
|
||||
|
||||
- job_name: service-kubernetes
|
||||
|
||||
kubernetes_sd_configs:
|
||||
- server: 'https://localhost:1234'
|
||||
username: 'myusername'
|
||||
password: 'mypassword'
|
2
prom/config/testdata/global_timeout.good.yml
vendored
Normal file
2
prom/config/testdata/global_timeout.good.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
global:
|
||||
scrape_timeout: 1h
|
2
prom/config/testdata/jobname.bad.yml
vendored
Normal file
2
prom/config/testdata/jobname.bad.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
scrape_configs:
|
||||
- job_name: prom^etheus
|
5
prom/config/testdata/jobname_dup.bad.yml
vendored
Normal file
5
prom/config/testdata/jobname_dup.bad.yml
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# Two scrape configs with the same job names are not allowed.
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
- job_name: service-x
|
||||
- job_name: prometheus
|
3
prom/config/testdata/labelname.bad.yml
vendored
Normal file
3
prom/config/testdata/labelname.bad.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
global:
|
||||
labels:
|
||||
not$allowed: value
|
3
prom/config/testdata/labelname2.bad.yml
vendored
Normal file
3
prom/config/testdata/labelname2.bad.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
global:
|
||||
labels:
|
||||
'not:allowed': value
|
5
prom/config/testdata/modulus_missing.bad.yml
vendored
Normal file
5
prom/config/testdata/modulus_missing.bad.yml
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
relabel_configs:
|
||||
- regex: abcdef
|
||||
action: hashmod
|
4
prom/config/testdata/regex.bad.yml
vendored
Normal file
4
prom/config/testdata/regex.bad.yml
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
relabel_configs:
|
||||
- regex: abc(def
|
4
prom/config/testdata/regex_missing.bad.yml
vendored
Normal file
4
prom/config/testdata/regex_missing.bad.yml
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
relabel_configs:
|
||||
- source_labels: ['blub']
|
3
prom/config/testdata/rules.bad.yml
vendored
Normal file
3
prom/config/testdata/rules.bad.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
rule_files:
|
||||
- 'my_rule' # fine
|
||||
- 'my/*/rule' # bad
|
7
prom/config/testdata/tgroup.bad.json
vendored
Normal file
7
prom/config/testdata/tgroup.bad.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"targets": ["1.2.3.4:9100"],
|
||||
"labels": {
|
||||
"some_valid_label": "foo",
|
||||
"oops:this-label-is-invalid": "bar"
|
||||
}
|
||||
}
|
20
prom/config/testdata/unknown_attr.bad.yml
vendored
Normal file
20
prom/config/testdata/unknown_attr.bad.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
# my global config
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 30s
|
||||
# scrape_timeout is set to the global default (10s).
|
||||
|
||||
labels:
|
||||
monitor: codelab
|
||||
foo: bar
|
||||
|
||||
rule_files:
|
||||
- "first.rules"
|
||||
- "second.rules"
|
||||
- "my/*.rules"
|
||||
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
|
||||
consult_sd_configs:
|
||||
- server: 'localhost:1234'
|
Reference in New Issue
Block a user