From daa6c9e5c76184a38a12be52583ab244ae3b1ad2 Mon Sep 17 00:00:00 2001 From: Alexander Brand Date: Fri, 1 Jun 2018 09:47:01 -0400 Subject: [PATCH] prometheus: envoy-statsd job ignore pods that don't have the statsd port annotation Signed-off-by: Alexander Brand --- deployment/prometheus/02-prometheus-configmap.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deployment/prometheus/02-prometheus-configmap.yaml b/deployment/prometheus/02-prometheus-configmap.yaml index 63c8a1d2..a4b155fe 100644 --- a/deployment/prometheus/02-prometheus-configmap.yaml +++ b/deployment/prometheus/02-prometheus-configmap.yaml @@ -323,6 +323,10 @@ data: - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] action: keep regex: true + # Only scrape pods that have the statsdport annotation set to a number + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_statsdport] + action: keep + regex: ^\d+$ - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_statsdport] action: replace regex: ([^:]+)(?::\d+)?;(\d+)