mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-13 17:14:05 -08:00
d7a7fd4589
* Support multiple masters with retries against each master as required. * Scrape masters' metrics. * Add role meta label for node/service/master to make it easier for relabeling.
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
# 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'
|
|
|
|
ca_cert: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
|
|
kubernetes_sd_configs:
|
|
- masters:
|
|
- 'https://kubernetes.default.svc'
|
|
in_cluster: true
|
|
|
|
relabel_configs:
|
|
- source_labels: [__meta_kubernetes_role, __meta_kubernetes_service_annotation_prometheus_io_scrape]
|
|
action: keep
|
|
regex: ^(?:(?:master|node);.*|.*;true)$
|
|
- 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
|