From 1ac10079c980cedb8fc54df3446e70d4368cccc8 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Wed, 19 Jul 2017 11:42:11 +0200 Subject: [PATCH] Split infra and workload monitoring for K8S This change allows to enable the monitoring only for the K8S infrastructure (default) or for both the infrastructure and the workloads running on top of K8S. Change-Id: Idc68576f2d64840c0454fadc204174027bbaa454 --- prometheus/files/prometheus.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/prometheus/files/prometheus.yml b/prometheus/files/prometheus.yml index e7652f3..a94d5a3 100644 --- a/prometheus/files/prometheus.yml +++ b/prometheus/files/prometheus.yml @@ -98,6 +98,7 @@ scrape_configs: {%- if server.get('target', {}).get('kubernetes', {}).get('enabled', False) %} {%- set kubernetes_target = server.target.kubernetes %} + - job_name: 'kubernetes-api' scheme: https tls_config: @@ -116,7 +117,6 @@ scrape_configs: action: keep regex: default;kubernetes;https - - job_name: 'kubernetes-node' scheme: https tls_config: @@ -134,7 +134,7 @@ scrape_configs: - action: labelmap regex: __meta_kubernetes_node_label_(.+) - + {%- if kubernetes_target.get('endpoint', {}).get('enabled') %} - job_name: 'kubernetes-service-endpoints' scheme: https tls_config: @@ -179,8 +179,9 @@ scrape_configs: - source_labels: [__meta_kubernetes_pod_name] action: replace target_label: kubernetes_pod_name + {%- endif %} - + {%- if kubernetes_target.get('pod', {}).get('enabled') %} - job_name: 'kubernetes-pod' scheme: https tls_config: @@ -215,6 +216,7 @@ scrape_configs: - source_labels: [__meta_kubernetes_pod_name] action: replace target_label: kubernetes_pod_name + {%- endif %} {%- endif %} {%- if server.get('target', {}).get('dns', {}).get('enabled', False) %}