diff --git a/production/helm/templates/promtail/configmap.yaml b/production/helm/templates/promtail/configmap.yaml index f0ecb9b49e6fd78bdf97afde952642658e133f7c..9f09bbb5b82ef5afa0976508fa025b6e3c314682 100644 --- a/production/helm/templates/promtail/configmap.yaml +++ b/production/helm/templates/promtail/configmap.yaml @@ -59,6 +59,10 @@ data: regex: ^$ source_labels: - __meta_kubernetes_pod_label_app + - action: drop + regex: .+ + source_labels: + - __meta_kubernetes_pod_label_name - action: replace replacement: $1 separator: / diff --git a/production/ksonnet/promtail/promtail.libsonnet b/production/ksonnet/promtail/promtail.libsonnet index 85166b302c474d61fef5e6c7d26b2321eea42435..c3aedd2df358854ae43f0d4f4779d47f6019c435 100644 --- a/production/ksonnet/promtail/promtail.libsonnet +++ b/production/ksonnet/promtail/promtail.libsonnet @@ -129,6 +129,14 @@ k { regex: '^$', }, + // Drop pods with a 'name' and an 'app' label. They will have already been added by + // the scrape_config that matches on the 'name' label + { + source_labels: ['__meta_kubernetes_pod_label_name'], + action: 'drop', + regex: '.+', + }, + // Rename jobs to be <namespace>/<app, from pod app label> { source_labels: ['__meta_kubernetes_namespace', '__meta_kubernetes_pod_label_app'], diff --git a/tools/promtail.sh b/tools/promtail.sh index 94ded053cac8691d4b0e49abb024b16e5f2629f2..f51f981b5928cac2483b0e149de536509c44e21f 100644 --- a/tools/promtail.sh +++ b/tools/promtail.sh @@ -65,6 +65,10 @@ data: regex: ^$ source_labels: - __meta_kubernetes_pod_label_app + - action: drop + regex: .+ + source_labels: + - __meta_kubernetes_pod_label_name - action: replace replacement: $1 separator: /