2015-07-18 21:23:58 +00:00
|
|
|
# A scrape configuration containing exactly one endpoint to scrape:
|
|
|
|
# Here it's Prometheus itself.
|
|
|
|
global:
|
|
|
|
scrape_interval: 15s # By default, scrape targets every 15 seconds.
|
|
|
|
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
|
|
|
|
scrape_timeout: 10s
|
|
|
|
|
|
|
|
scrape_configs:
|
|
|
|
- job_name: 'kubernetes'
|
|
|
|
|
2015-09-06 23:07:44 +00:00
|
|
|
tls_config:
|
|
|
|
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
|
|
|
2015-09-03 09:47:09 +00:00
|
|
|
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
|
|
|
2015-07-18 21:23:58 +00:00
|
|
|
kubernetes_sd_configs:
|
2015-09-03 09:47:09 +00:00
|
|
|
- masters:
|
|
|
|
- 'https://kubernetes.default.svc'
|
2015-07-18 21:23:58 +00:00
|
|
|
in_cluster: true
|
|
|
|
|
|
|
|
relabel_configs:
|
2015-09-03 09:47:09 +00:00
|
|
|
- source_labels: [__meta_kubernetes_role, __meta_kubernetes_service_annotation_prometheus_io_scrape]
|
2015-07-18 21:23:58 +00:00
|
|
|
action: keep
|
2015-09-03 09:47:09 +00:00
|
|
|
regex: ^(?:(?:master|node);.*|.*;true)$
|
2015-07-18 21:23:58 +00:00
|
|
|
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]
|
|
|
|
action: replace
|
|
|
|
target_label: __scheme__
|
|
|
|
regex: ^(https?)$
|
|
|
|
replacement: $1
|
|
|
|
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
|
|
|
|
action: replace
|
|
|
|
target_label: __metrics_path__
|
|
|
|
regex: ^(.+)$
|
|
|
|
replacement: $1
|
|
|
|
- source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
|
|
|
|
action: replace
|
|
|
|
target_label: __address__
|
|
|
|
regex: ^(.+)(?::\d+);(\d+)$
|
|
|
|
replacement: $1:$2
|