Kubernetes SD config tidy & add labelmap action example

This commit is contained in:
Jimmi Dyson 2015-09-29 08:59:35 +01:00
parent a88ed8c2ff
commit e26fc5e73c
1 changed files with 3 additions and 3 deletions

View File

@ -9,9 +9,6 @@ scrape_configs:
- masters: - masters:
- 'https://kubernetes.default.svc' - 'https://kubernetes.default.svc'
in_cluster: true in_cluster: true
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
relabel_configs: relabel_configs:
- source_labels: [__meta_kubernetes_role, __meta_kubernetes_service_annotation_prometheus_io_scrape] - source_labels: [__meta_kubernetes_role, __meta_kubernetes_service_annotation_prometheus_io_scrape]
@ -32,3 +29,6 @@ scrape_configs:
target_label: __address__ target_label: __address__
regex: ^(.+)(?::\d+);(\d+)$ regex: ^(.+)(?::\d+);(\d+)$
replacement: $1:$2 replacement: $1:$2
- action: labelmap
regex: ^__meta_kubernetes_service_label_(.+)$
replacement: $1